try positional format strings

This commit is contained in:
neingeist 2014-04-19 13:02:33 +02:00
parent cb3c9c0874
commit ad287fd9a8
3 changed files with 11 additions and 1 deletions

1
.gitignore vendored
View file

@ -32,3 +32,4 @@ multibrot-openmp
multibrot-openmp.png
hello-openmp
mandelbrot-openmp
positional-format-strings

View file

@ -9,7 +9,8 @@ TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs \
ncurses-pong bit-fuckery bit-fuckery2 checkcheck multibrot bloom \
wo-lernen lua-foo binsearch test-inline-assembly uiowa-threads-example \
mtrace-test av-variance undefined-behaviour \
multibrot-openmp hello-openmp mandelbrot-openmp
multibrot-openmp hello-openmp mandelbrot-openmp \
positional-format-strings
EXTRAS=mandelbrot.bmp multibrot.png test-inline-assembly.s tags \
mtrace-test.trace mtrace-test.txt multibrot-openmp.png
VERYEXTRAS=cppcheck.txt

View file

@ -0,0 +1,8 @@
#include <stdio.h>
/* suppress "warning: positional arguments are not supported by ISO C" */
#pragma GCC diagnostic ignored "-Wformat-non-iso"
int main(void) {
printf("%3$3.2f %2$s %1$s\n", "One", "Two", 3.0);
}