This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/82167] New: Segmentation fault when dereferencing the address of an array argument
- From: "felix.von.s at posteo dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 10 Sep 2017 11:43:03 +0000
- Subject: [Bug c/82167] New: Segmentation fault when dereferencing the address of an array argument
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82167
Bug ID: 82167
Summary: Segmentation fault when dereferencing the address of
an array argument
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: felix.von.s at posteo dot de
Target Milestone: ---
Host: i686-linux-gnu
Target: i686-linux-gnu
Created attachment 42145
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42145&action=edit
Result of running gcc -v -S on the source code given
Attempting to compile the code below triggers a segmentation fault in the
front-end.
int main(int argc, char *argv[]) {
__builtin_printf("%zu\n", sizeof(*&argv));
return 0;
}
I discovered this when I was searching for a way to locally silence
-Wsizeof-array-argument (without necessarily knowing if a variable was declared
as an array in the first place), in relation to my comment under bug #14557. Is
there any way to do that, by the way?