From: thutt@vmware.com
To: gcc@gcc.gnu.org
Subject: Narrowing down preprocessor-related potential defect
Date: Tue, 21 Jun 2022 12:30:55 -0700 [thread overview]
Message-ID: <25266.7279.168888.944211@thutt-l01.ddns.vmware.com> (raw)
Hello folks,
I am not subscribed to this mailing list, so please address
responses directly to me.
I have a program that generates this error:
<file>.c: In function ‘f0’:
<file>.c:117:4: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
117 | //#endif //
| ^~~~
<file>.c:120:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
120 | }
| ^
cc1: all warnings being treated as errors
for this small snippet of code:
void *
f0(void *ip6hdr)
{
if (ip6hdr) {
//#ifdef KQD
// } else if (0) {
//#endif //
} else if (ip6hdr) {
} else {
}
return 0;
}
The failure was induced by a commit to a header file that is not
even directly included by this source file.
To produce the error the file must include a large swath of header
files (some part of FreeBSD, some proprietary). Additionally, the
failure is very, very sensitive to the contents of the source &
included header files.
Normally, to investigate a potential gcc defect, one would
preprocess the file and pare down the output. But, preprocessing
the input and compiling the preprocessed output causes the failure
to evaporate. This is probably because the standalone preprocessor
does not produce a verbatim rendering of the input sources.
Nevertheless, the preprocessed output, containing proprietary code,
is on the order of 80K lines, which is too large (IMHO) to submit
in a defect report. Consequently, I need to narrow this down
further. But, making progress beyond the current state is
challenging because the failure is very sensitive to the contents
of the input source, and header files are including other headers
to a depth of 13.
I am here to solicit ideas on how to further narrow this this
down. Is there any undocumented option that I can use to cause the
standalone preprocessor to produce output identical to input?
Note that '-traditional-cpp' does not work because some of the code
is not recognized (variadic macros, for example).
thutt
--
next reply other threads:[~2022-06-21 19:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 19:30 thutt [this message]
2022-06-21 19:35 ` Jonathan Wakely
2022-06-21 19:47 ` Jonathan Wakely
2022-06-21 20:25 ` thutt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25266.7279.168888.944211@thutt-l01.ddns.vmware.com \
--to=thutt@vmware.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).