try positional format strings
This commit is contained in:
parent
cb3c9c0874
commit
ad287fd9a8
3 changed files with 11 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -32,3 +32,4 @@ multibrot-openmp
|
||||||
multibrot-openmp.png
|
multibrot-openmp.png
|
||||||
hello-openmp
|
hello-openmp
|
||||||
mandelbrot-openmp
|
mandelbrot-openmp
|
||||||
|
positional-format-strings
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -9,7 +9,8 @@ TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs \
|
||||||
ncurses-pong bit-fuckery bit-fuckery2 checkcheck multibrot bloom \
|
ncurses-pong bit-fuckery bit-fuckery2 checkcheck multibrot bloom \
|
||||||
wo-lernen lua-foo binsearch test-inline-assembly uiowa-threads-example \
|
wo-lernen lua-foo binsearch test-inline-assembly uiowa-threads-example \
|
||||||
mtrace-test av-variance undefined-behaviour \
|
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 \
|
EXTRAS=mandelbrot.bmp multibrot.png test-inline-assembly.s tags \
|
||||||
mtrace-test.trace mtrace-test.txt multibrot-openmp.png
|
mtrace-test.trace mtrace-test.txt multibrot-openmp.png
|
||||||
VERYEXTRAS=cppcheck.txt
|
VERYEXTRAS=cppcheck.txt
|
||||||
|
|
8
positional-format-strings.c
Normal file
8
positional-format-strings.c
Normal 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);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue