This is the mail archive of the gcc-patches@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: [PATCH] Optimize sprintf(buffer,"foo")


Roger Sayle <roger@eyesopen.com> writes:
> extern int sprintf(char*, const char*, ...);
> [...]
> 
> #ifdef __OPTIMIZE__
> /* When optimizing, all the above cases should be transformed into
>    something else.  So any remaining calls to the original function
>    should abort.  */
> __attribute__ ((noinline))
> static int
> sprintf (char *buf, const char *fmt, ...)
> {
>   abort ();
> }
> #endif

Please use builtins.exp for this!  static-after-extern isn't valid C
and isn't supported on all targets.

Richard


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