]> git.ipfire.org Git - thirdparty/glibc.git/blame - stdio-common/Makefile
vfprintf: Fix memory with large width and precision [BZ #19931]
[thirdparty/glibc.git] / stdio-common / Makefile
CommitLineData
f7a9f785 1# Copyright (C) 1991-2016 Free Software Foundation, Inc.
deab9dea
RM
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5# modify it under the terms of the GNU Lesser General Public
6# License as published by the Free Software Foundation; either
7# version 2.1 of the License, or (at your option) any later version.
deab9dea
RM
8
9# The GNU C Library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12# Lesser General Public License for more details.
deab9dea 13
41bdb6e2 14# You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15# License along with the GNU C Library; if not, see
16# <http://www.gnu.org/licenses/>.
deab9dea
RM
17
18#
19# Specific makefile for stdio-common.
20#
21subdir := stdio-common
22
a5f891ac
JM
23include ../Makeconfig
24
4962050e 25headers := stdio_ext.h printf.h bits/printf-ldbl.h bits/stdio_lim.h
deab9dea
RM
26
27routines := \
28 ctermid cuserid \
cb7c4a27 29 _itoa _itowa itoa-digits itoa-udigits itowa-digits \
af6f3906 30 vfprintf vprintf printf_fp reg-printf printf-prs printf_fphex \
9d26efa9 31 reg-modifier reg-type \
3e5f5557 32 printf_size fprintf printf snprintf sprintf asprintf dprintf \
934b77ac 33 vfwprintf vfscanf vfwscanf \
deab9dea
RM
34 fscanf scanf sscanf \
35 perror psignal \
dfd2257a 36 tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \
deab9dea 37 getline getw putw \
26cec518 38 remove rename renameat \
874aa523
UD
39 flockfile ftrylockfile funlockfile \
40 isoc99_scanf isoc99_vscanf isoc99_fscanf isoc99_vfscanf isoc99_sscanf \
1f04d005
UD
41 isoc99_vsscanf \
42 psiginfo
fafaa44e 43
10ffcd52 44aux := errlist siglist printf-parsemb printf-parsewc fxprintf
deab9dea 45
95b04192 46tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
c131718c 47 temptest tst-fileno test-fwrite tst-ungetc tst-ferror \
deab9dea 48 xbug errnobug \
1e9f6e98 49 bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 bug12 bug13 \
b1195070 50 tfformat tiformat tllformat tstdiomisc tst-printfsz tst-wc-printf \
60876a75 51 scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \
8a207204 52 scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \
30bce7b6 53 tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \
5fefb436 54 tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 \
cae6ebb2 55 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
0923a2c8 56 tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
ad8a5511 57 bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
7c1f4834 58 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \
b0bc23a1 59 bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \
560b0446 60 bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26 tst-fmemopen3 \
fdcf1c94 61 tst-printf-bz18872 tst-vfprintf-width-prec
deab9dea 62
95b04192 63test-srcs = tst-unbputc tst-printf
6f98fd7e 64
f214606a
JM
65ifeq ($(run-built-tests),yes)
66tests-special += $(objpfx)tst-unbputc.out $(objpfx)tst-printf.out \
560b0446 67 $(objpfx)tst-printf-bz18872-mem.out \
fdcf1c94
FW
68 $(objpfx)tst-setvbuf1-cmp.out \
69 $(objpfx)tst-vfprintf-width-prec-mem.out
560b0446 70generated += tst-printf-bz18872.c tst-printf-bz18872.mtrace \
fdcf1c94
FW
71 tst-printf-bz18872-mem.out \
72 tst-vfprintf-width-prec.mtrace tst-vfprintf-width-prec-mem.out
f214606a
JM
73endif
74
deab9dea 75include ../Rules
0793d348 76
f881f6ff
AS
77ifeq ($(run-built-tests),yes)
78LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ISO-8859-1 ja_JP.EUC-JP
79include ../gen-locales.mk
80
81$(objpfx)bug14.out: $(gen-locales)
82$(objpfx)scanf13.out: $(gen-locales)
83$(objpfx)test-vfprintf.out: $(gen-locales)
84$(objpfx)tst-grouping.out: $(gen-locales)
85$(objpfx)tst-sprintf.out: $(gen-locales)
86$(objpfx)tst-sscanf.out: $(gen-locales)
87$(objpfx)tst-swprintf.out: $(gen-locales)
88endif
89
560b0446 90tst-printf-bz18872-ENV = MALLOC_TRACE=$(objpfx)tst-printf-bz18872.mtrace
fdcf1c94
FW
91tst-vfprintf-width-prec-ENV = \
92 MALLOC_TRACE=$(objpfx)tst-vfprintf-width-prec.mtrace
560b0446 93
57c69bef 94$(objpfx)tst-unbputc.out: tst-unbputc.sh $(objpfx)tst-unbputc
f0881698
JM
95 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
96 $(evaluate-test)
6f98fd7e 97
57c69bef 98$(objpfx)tst-printf.out: tst-printf.sh $(objpfx)tst-printf
f0881698
JM
99 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
100 $(evaluate-test)
560b0446
PP
101
102# We generate this source because it requires a printf invocation with
103# 10K arguments.
104$(objpfx)tst-printf-bz18872.c: tst-printf-bz18872.sh
105 rm -f $@ && $(BASH) $^ > $@.new && mv $@.new $@
106
fdcf1c94
FW
107$(objpfx)tst-%-mem.out: $(objpfx)tst-%.out
108 $(common-objpfx)malloc/mtrace $(objpfx)tst-$*.mtrace > $@; \
560b0446 109 $(evaluate-test)
95b04192 110
01c901a5 111CFLAGS-vfprintf.c = -Wno-uninitialized
701666b7 112CFLAGS-vfwprintf.c = -Wno-uninitialized
ec4b0518 113
73299943
UD
114CFLAGS-tmpfile.c = -fexceptions
115CFLAGS-tmpfile64.c = -fexceptions
116CFLAGS-tempname.c = -fexceptions
cdbfa9f8 117CFLAGS-psignal.c = -fexceptions
5777d565 118CFLAGS-vprintf.c = -fexceptions
8dab36a1 119CFLAGS-cuserid.c = -fexceptions
874aa523 120
56ab3869
JM
121CFLAGS-vfprintf.c += -fexceptions
122CFLAGS-fprintf.c += -fexceptions
123CFLAGS-printf.c += -fexceptions
124CFLAGS-vfwprintf.c += -fexceptions
125CFLAGS-vfscanf.c += -fexceptions
126CFLAGS-vfwscanf.c += -fexceptions
127CFLAGS-fscanf.c += -fexceptions
128CFLAGS-scanf.c += -fexceptions
129CFLAGS-isoc99_vfscanf.c += -fexceptions
130CFLAGS-isoc99_vscanf.c += -fexceptions
131CFLAGS-isoc99_fscanf.c += -fexceptions
132CFLAGS-isoc99_scanf.c += -fexceptions
795985e4
UD
133CFLAGS-errlist.c = $(fno-unit-at-a-time)
134CFLAGS-siglist.c = $(fno-unit-at-a-time)
73299943 135
ad8a5511 136# The following is a hack since we must compile scanf1{5,7}.c without any
874aa523
UD
137# GNU extension. The latter are needed, though, when internal headers
138# are used. So made sure we see the installed headers first.
139CFLAGS-scanf15.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
140 -I../wctype
ad8a5511
JJ
141CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
142 -I../wctype
874aa523 143
c75ccd4c 144CPPFLAGS += $(libio-mtsafe)
75684bd7 145
6e89caf1 146$(objpfx)tst-setvbuf1.out: /dev/null $(objpfx)tst-setvbuf1
f0881698
JM
147 $(test-program-cmd) > $@ 2>&1; \
148 $(evaluate-test)
6e89caf1
JM
149
150$(objpfx)tst-setvbuf1-cmp.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1.out
f0881698
JM
151 cmp $^ > $@; \
152 $(evaluate-test)
784761be 153
79520f4b 154$(objpfx)tst-printf-round: $(libm)