[Bug c/92720] cc1 accepts #include /dev/stdin inline

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 29 11:54:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92720

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #2)
> (In reply to Dennis Clarke from comment #0)
> > This may require a bit of a dive into the specifications however
> > an inline include of /dev/stdin seems wrong for some definition
> > of wrong. 
> 
> There's no such thing as an "inline include", the preprocessor just
> substitutes the content of the named file wherever a #include directive
> appears.
> 
> If that file happens to be /dev/stdin then it happens to be /dev/stdin.

The actual mapping from a #include directive to a physical file is
implementation defined, so it seems OK for one compiler to refuse to do include
certain paths, and OK for another to do so.


More information about the Gcc-bugs mailing list