[PATCH] D11658: [Sema] main can't be declared as global variable

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 15:43:20 PDT 2015


rsmith added a comment.

Looks good other than the diagnostic wording.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:513
@@ -512,1 +512,3 @@
     "platform-specific data}0) must be of type %1">;
+def err_main_global_variable : Error<"main can't be declared as global variable">;
+def warn_main_redefined : Warning<"external-linkage variable named 'main' has "
----------------
It's much more common to use "cannot" rather than the contraction "can't" in our diagnostic wording.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:514
@@ +513,3 @@
+def err_main_global_variable : Error<"main can't be declared as global variable">;
+def warn_main_redefined : Warning<"external-linkage variable named 'main' has "
+    "undefined behavior">, InGroup<Main>;
----------------
I would still like this reworded.


http://reviews.llvm.org/D11658





More information about the cfe-commits mailing list