[PATCH] D124702: [MSVC] Add support for pragma function

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 12 06:32:06 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/test/Preprocessor/pragma_microsoft.c:210
+#pragma function(main)                   // expected-warning {{'main' is not a recognized builtin; consider including <intrin.h>}}
+#pragma function(                        // expected-warning {{missing ')' after}}
+#pragma function(int)                    // expected-warning {{missing ')' after}}
----------------
steplong wrote:
> Hmm does it make sense for this to be a warning and not an error?
I'm glad I'm not the only one who questioned this. :-D I tend to be of the opinion that syntax errors should be errors rather than warnings. However, this is using an existing warning that's used by a bunch of other pragmas so I think it's defensible to use it here, especially given that this pragma form is commonly used for compiler extensions (so who knows, the syntax could be valid for another compiler, I guess).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124702/new/

https://reviews.llvm.org/D124702



More information about the cfe-commits mailing list