c - __isoc99_scanf and scanf -
i studying various compiler option in gcc , observing changes when made changes in standard used.
$ gcc q1.c -wall -save-temps -o q1 $ vi q1.s
i see 1 of opcodes as
call __isoc99_scanf
and when compile c89 standards
$gcc q1.c -wall -save-temps -std=c89 -o q1 $ vi q1.s
i see opcode as
call scanf
what difference between these 2 forms of scanf
? link can see source highly appreciated.
the reason strict following of c99 disallow existing gnu extension conversion specifiers.
in glibc 2.17, in libio/stdio.h
there comment:
/* strict iso c99 or posix compliance disallow %as, %as , %a[ gnu extension conflicts valid %a followed letter s, s or [. */ extern int __redirect (fscanf, (file *__restrict __stream, const char *__restrict __format, ...), __isoc99_fscanf) __wur; extern int __redirect (scanf, (const char *__restrict __format, ...), __isoc99_scanf) __wur; extern int __redirect_nth (sscanf, (const char *__restrict __s, const char *__restrict __format, ...), __isoc99_sscanf);
Comments
Post a Comment