https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108732
Bug ID: 108732
Summary: Pre-compiled headers cannot be output to /dev/null
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: matt at immute dot net
Target Milestone: ---
with GCC 12, the following command fails with a fairly obscure error:
$ gcc12.2.0 -c foo.h -o /dev/null
foo.h:1: fatal error: cannot write PCH file: required memory segment
unavailable
compilation terminated.
This also fails when invoked via g++. It works fine if the output is a normal
file, and it always worked with previous GCC versions, so this is a pretty
surprising change.
This may seem like a strange thing to want to do, but I maintain a number of
builds that do similar invocations to verify that each header file is
self-contained.
Either way, I think it would be best to fix it, or if that's not possible, it
would be nice to improve the error message at the very least.