Skip to content

#pragma warning #610

Closed
Closed
@Daniel-Cortez

Description

@Daniel-Cortez

Issue description:

Apparently #pragma warning disable isn't being reset at the end of each compilation pass, resulting in its effects being carried onto the subsequent compilation passes.

// This should result in "warning 238: meaningless combination of class
// specifiers (const reference)", but the compiler doesn't print it, because
// warning 238 is disabled later on the 1'st pass and its on/off status
// is not being reset before the next pass.
stock Func(const &arg) return arg;
#pragma warning disable 238

main(){}

Another problem is that if #pragma warning push is used more times than #pragma warning pop or vice versa, the compiler silently ignores this.

main() {}
#pragma warning pop // no errors/warnings, although there was no "#pragma warning push"
                    // (the user probably forgot to use it)

I think the compiler should inform the user if they forgot to use #pragma warning push/pop, in the same way as it already does for #if/#endif.

Minimal complete verifiable example (MCVE):

Workspace Information:

  • Compiler version: 3.10.10
  • Command line arguments provided (or sampctl version):
  • Operating System:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions