This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Test standard function names?
- From: Phil Edwards <phil at jaj dot com>
- To: Kevin Handy <kth at srv dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 16 Sep 2002 14:55:19 -0400
- Subject: Re: Test standard function names?
- References: <3D839552.3090604@srv.net>
On Sat, Sep 14, 2002 at 02:00:18PM -0600, Kevin Handy wrote:
> Would it be possible to have an error displayed when someone tries
> to define a function with the name of one of the standard library
> function names?
That would be nice for many reasons, but it's not going to happen soon.
For one thing, it's a lot of work. You didn't mention what language you
had in mind, but there are /many/ names in the C standard library, and
/many many/ in the C++ standard library.
> You would only want to display the error when
> the function body was there, so that prototypes wouldn't trigger
> the message.
Other things besides functions can collide. This gets tricky quite fast.
> There would be a need to turn off the message so
> that those writing the system library wouldn't have to see it.
Well, first, this warning probably woudln't be on by default. And secondly,
all the warning options come with a way fo turning them off, just by virtue
of the way they're parsed. Every -Wfoo has a -Wno-foo.
Phil
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002