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

Bug#155835: libc6-dev: scanf a flag conflicts with C99



On 20041218T201450+0900, GOTO Masanori wrote:
> Could you provide a sample test program for the latest sarge glibc/gcc?

I'm running sid, so this is tested on sid:

The following demonstrates that the bug is still valid:

ajk@kukkaruukku[13:43:18]:~$ dpkg -l libc6 gcc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                   Version                Description
+++-======================-======================-============================================================
ii  libc6                  2.3.2.ds1-19           GNU C Library: Shared libraries and Timezone data
ii  gcc                    3.3.5-1                The GNU C compiler
ajk@kukkaruukku[14:04:26]:~$ cat bug155835.c 
#include <stdio.h>

int main(void)
{
        char *s;
        scanf("%as", &s);
        // if this echoes what you wrote,
        // the bug is still valid (%as has GNU semantics)
        printf("Read: %s\n", s); 
        return 0;
}
ajk@kukkaruukku[14:04:30]:~$ gcc --std=c99 -Wall bug155835.c
bug155835.c: In function `main':
bug155835.c:6: warning: float format, pointer arg (arg 2)
ajk@kukkaruukku[14:04:39]:~$ ./a.out 
foo
Read: foo
ajk@kukkaruukku[14:04:43]:~$ 

-- 
Antti-Juhani Kaijanaho, Debian developer 

http://kaijanaho.info/antti-juhani/blog/en/debian

Attachment: signature.asc
Description: Digital signature


Reply to: