repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
builtins
/
lib
/
sprintf.c
blob
3ac447b117f81f0f9905ce49bc03243ecb87c995
1
#include <stdio.h>
2
#include <stdarg.h>
3
extern
void
abort
(
void
);
4
extern
int
inside_main
;
5
6
__attribute__
((
__noinline__
))
7
int
8
(
sprintf
) (
char
*
buf
,
const char
*
fmt
, ...)
9
{
10
va_list
ap
;
11
int
r
;
12
#ifdef __OPTIMIZE__
13
if
(
inside_main
)
14
abort
();
15
#endif
16
va_start
(
ap
,
fmt
);
17
r
=
vsprintf
(
buf
,
fmt
,
ap
);
18
va_end
(
ap
);
19
return
r
;
20
}
21
22