This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/82167] New: Segmentation fault when dereferencing the address of an array argument


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]