This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: How to check that selectors exist
- From: Stan Shebs <shebs at apple dot com>
- To: Nicola Pero <nicola at brainstorm dot co dot uk>
- Cc: Devang Patel <dpatel at apple dot com>, gnustep-dev at gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 09 Aug 2002 11:01:00 -0700
- Subject: Re: How to check that selectors exist
- References: <Pine.LNX.4.21.0208081610190.11015-100000@nicola.brainstorm.co.uk>
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