On Fri, Nov 13, 2020 at 09:57:31AM -0500, Austin Morton via Gcc-patches wrote: > On the contrary, as a user of GCC I would much prefer a consistent > behavior for #pragma region based purely on GCC version. > > IE, so you can tell people: > "just update to GCC X.Y and those warnings will go away" > rather than: > "update to GCC X.Y and pass some new flags - but make sure > not to pass them to old GCC versions, since that will generate > a new warning" > > I do agree it may be generally useful to have a configurable way to > specify pragmas to ignore at runtime, but that is not what I was trying > to accomplish here. > > Both clang and MSVC handle this pragma without any runtime > configuration, and I think GCC should as well.
But in that case the pragma shouldn't be ignored, but instead checked against the various requirements. E.g. that region is followed by a single optional name (are there any requirements on what name can be, can it be just a single token, can it be C/C++ keyword, etc.), guess ignore all the tokens after endregion if it is all a comment, and verify nesting (all region/endregion are properly paired up). Jakub