This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR6321


Dirk Mueller wrote:
On Monday, 30. October 2006 04:23, Mark Mitchell wrote:

The idea of this patch is fine, but the function name main_args_warning
isn't very good.  Please use "check_type_of_main" instead.

$ grep " check_" c-common.h | wc -l 4 $ grep "_warning" c-common.h | wc -l 6

I'm not impressed. :-) It's not a big enough sample to prove much about consistency. This function does things, so it should have an active verb-ish name. "main_args_warning" is the name of a variable, IMO.


I don't want to argue, but the function doesn't actually check the (return) type of the function. How about "check_main_arguments" or "check_main_function_arguments" ?

From your patch:


+  if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl)))
+     != integer_type_node)
+   pedwarn ("return type of %q+D is not %<int%>", decl);

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]