tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: constify dirname/basename [was: CVS commit: src]



der Mouse wrote:-

> >>> It means user-space code redeclaring the function will now get an
> >>> incompatible redclaration error.
> >> [...], user code should never do that.
> > Indeed, C99 Example 7.1.4p5 that explicitly lists such a construct as
> > an example of how to use standard library functions
> 
> No; that's not an exmaple of *re*declaring the library function.  If
> they had included the header *and* added the explicit declaration,
> *then* it would have been an example of what we're talking about here.

Good point, I'd not realized that.  7.1p3 right?

However, that doesn't help.  I can still expect to be able to compile
the following code at function scope:

        char * (*p) (char *);
        p = basename;

which one cannot with GCC in strict mode if the prototype of basename
changes.  So I still maintain we have to retain prototype compatibility
of any library header function.

Neil.


Home | Main Index | Thread Index | Old Index