This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] Fix PR bootstrap/42798


On 06/04/2010 04:59 PM, Ian Lance Taylor wrote:
With regard to the gold change.  What will happen if the system header
files provide only a declaration
     char *basename(const char *)
?

I think it works, because C casts are allowed to do anything they want to constness.


Certainly both of the following compile fine:

char *f(const char *x) { }
typedef char *(*funtype) (char *g);
funtype gg = (char * (*) (char *)) f;


char *f(char *x) { } typedef char *(*funtype) (const char *g); funtype gg = (char * (*) (const char *)) f;


Paolo



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