Summary: | GCC header file <stdio.h> fails to properly define snprintf() | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Tom Fredrik Blenning Klaussen <bfg-dev> |
Component: | [OLD] GCC Porting | Assignee: | Please assign to toolchain <gcc-porting> |
Status: | VERIFIED INVALID | ||
Severity: | minor | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Testcase to demonstrate problem |
Description
Tom Fredrik Blenning Klaussen
2005-04-06 06:04:05 UTC
Created attachment 55459 [details]
Testcase to demonstrate problem
When compiling with "-ansi" switch (ISO C90), then the prototype for snprintf is #ifdef'd out, cause (excerp of man snprintf): The fprintf, printf, sprintf, vprintf, vfprintf, and vsprintf functions conform to ANSI X3.159-1989 (``ANSI C'') and ISO/IEC 9899:1999 (``ISO C99''). The snprintf and vsnprintf functions conform to ISO/IEC 9899:1999. So if you really want "-ansi" to force ISO C90 standard for some (portability?) reasons, then don't use snprintf... That certainly seems to explain things. Sorry, marking this as invalid Closing this bug |