Here is what our plumbing code has to say, most others are similar-
VENT TERMINALS. All vents and vent systems shall terminate in the open air in accordance with this subsection.
(a) Extension above roofs. Extensions of vents through a roofshall terminate at least 8" above the roof. Where the roof is to be used for any purpose other than weather protection, the vents shall extend at least 7 feet above the roof.
(b) Waterproof flashings. The penetration of a roof system bya vent shall be made watertight with an approved flashing.
(c) Prohibited uses. Vent terminals shall not be used as flagpoles, support for antennas or other similar purposes.
(d) Location of vent terminals. 1. A vent shall not terminate under the overhang of a building. 2. All vent terminals shall be located:
a. At least 10 feet from an air intake;
b. At least 5 feet from a power exhaust vent;
c. At least 10 feet horizontally from or 2 feet above roofscuttles, doors and openable windows; and
d. At least 5 feet from or 2 inches above parapet walls.
3. Where a structure has an earth covered roof extending from surrounding grade, the vent extension shall run at least 7 feet above grade and terminate with an approved vent cap. The portion of vent pipe outside the structure shall be without joints, except one fitting may be installed where the pipe leaves the top or side of the structure.(e) Extension through wall. Where specifically approved by the department, a vent may terminate through an exterior wall. Such a vent shall terminate at least 10 feet horizontally from any lot line and shall terminate downward. The vent shall be screened and shall comply with par. (d).
(f) Extensions outside buildings. Drain or vent pipe extensions shall not be located or placed on the outside of an exterior wall of any new building, but shall be located inside the building.
(g) Frost closure. For protection against frost closure, eachvent terminal shall be at least 2" in diameter. Where it is necessary to increase the diameter of the vent, the change in diameter shall be made at least 6" inside the building.