[Bug c/92720] cc1 accepts #include /dev/stdin inline
dclarke at blastwave dot org
gcc-bugzilla@gcc.gnu.org
Sat Nov 30 21:17:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92720
--- Comment #8 from Dennis Clarke <dclarke at blastwave dot org> ---
(In reply to joseph@codesourcery.com from comment #6)
.
.
.
> In turn, that section "Include Operation" has more details. It doesn't
> mention includes with an absolute path, but I think that's because the
> general concept of resolving a path relative to a directory, and how that
> handles absolute paths, is one for the underlying operating system, not
> for any particular application running on that operating system.
I hope someone agrees that this seems like black magic :
esther$
esther$ uname -a
Linux esther 5.3.0-2-686 #1 SMP Debian 5.3.9-3 (2019-11-19) i686 GNU/Linux
esther$ cat /proc/version
Linux version 5.3.0-2-686 (debian-kernel@lists.debian.org) (gcc version 9.2.1
20191109 (Debian 9.2.1-19)) #1 SMP Debian 5.3.9-3 (2019-11-19)
esther$ gcc --version
gcc (Debian 9.2.1-19) 9.2.1 20191109
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
esther$ ( /usr/bin/printf "\042"; dd if=/dev/urandom bs=16 count=1 2>/dev/null
| od -Ax -t x1 -v | tr -d '\012' | cut -c8-54 | tr -d '\012';/usr/bin/printf
"\042\n" ) | gcc -std=iso9899:1999 -pedantic -pedantic-errors -Wpedantic
-fno-builtin -O0 -D_XOPEN_SOURCE=600 -o /tmp/wtf /tmp/wtf.c
esther$ /tmp/wtf
1e e8 6e 82 6a a4 0b 66 0f d5 48 33 2a 86 21 6b
esther$
Which makes one wonder what would happen if I were to merely include
/dev/urandom directly.
Dennis
More information about the Gcc-bugs
mailing list