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: How to check that selectors exist


Nicola Pero wrote:


Here is a set of patches implementing -Wundeclared-selector as promised.

NB: I will be leaving for two weeks on saturday (holidays finally :-). If Stan approves it when I'm away, I'm happy with anyone else applying it
(including any sort of reformatting and improvements which might be
necessary). Else, I'll apply it if approved before I leave (which I
doubt, given how slow Stan is in approving :-), or when I am back.

Just for that :-), here's the OK.  (modulo a couple nits)

+/*
+ * This function is called by the parser when a @selector() expression
+ * is found, in order to compile it.  It is only called by the parser
+ * and only to compile a @selector().
+ */

The usual style is not to have leading '*' in comment blocks.


+ warning ("unknown (undeclared) selector `%s'", + IDENTIFIER_POINTER (selname));

I suggest phrasing this as just "undeclared selector `%s'".  The use of
both terms made me wonder if it were possible to have known but
undeclared selectors, or vice versa.

 (METHOD_SEL_NAME (mchain) == key)
-	return mchain;
+	{
+	  return mchain;
+	}

Coding style sez not to do this change.

Also, you need to document it in doc/invoke.texi, otherwise the users
might never learn of this nice new warning's existence!

Stan



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