Construct30
The codes (both UPC & IPC) are concerned with pipe passing through framing members. Subflooring is not a framing memeber. The orignial picture doesn't show the pipe passing through the joists. What do you do with drains and vents inside walls? Run a steel plate from floor to ceiling? I don't think attaching the pipe to the subfloor is ideal, but I don't think it violates any codes.
IPC 305.8 Protection against physical damage.
In concealed locations where piping, other than cast-iron or galvanized steel, is installed through holes or notches in studs, joists, rafters or similar members less than 1.5 inches (38 mm) from the nearest edge of the member, the pipe shall be protected by shield plates. Protective shield plates shall be a minimum of 0.062-inch-thick (1.6 mm) steel, shall cover the area of the pipe where the member is notched or bored, and shall extend a minimum of 2 inches (51 mm) above sole plates and below top plates