This is the mail archive of the gcc@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: Test standard function names?


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


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