Pragma Scope

The scope of a pragma setting is usually limited to a single compilation unit.

As discussed in Pragma Syntax, you should use on or off after the name of the pragma to change its setting to the desired condition. All code after that point is compiled with that setting until either:

At the beginning of each file, the compiler reverts to the target or default settings.