rsion: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rilium at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38173
--- Comment #1 from rilium at mail dot ru 2008-10-31 02:11 ---
Created an attachment (id=16593)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16593&action=view)
Preproccessed file test.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37975
;
extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern void perror (__const char *__s);
# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
# 27 "/usr/include/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern __const char *__const sys_errlist[];
# 823 "/usr/include/stdio.h" 2 3 4
extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
# 842 "/usr/include/stdio.h" 3 4
extern FILE *popen (__const char *__command, __const char *__modes) ;
extern int pclose (FILE *__stream);
extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
# 882 "/usr/include/stdio.h" 3 4
extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
# 912 "/usr/include/stdio.h" 3 4
# 4 "test.c" 2
void f(const char* str1, const char* str2)
{
const char* fmt = "Something is: %s, and something another is: %s\n";
const size_t buff_len = strlen(fmt) + strlen(str1) + strlen(str2) + 1;
char* buff = (char*)malloc(buff_len);
sprintf(buff, fmt, "Str1", "str2");
free(buff);
}
int main()
{
return 0;
}
--
Summary: Incorrect argument checking for printf: "format not a
string literal, argument types not checked", where it
can be checked
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rilium at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37975