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

            Bug ID: 118106
           Summary: Erroneous warning: variably modified '<variable>' at
                    file scope
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: beni.falk at gmail dot com
  Target Milestone: ---

Created attachment 59908
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59908&action=edit
Result of running the compiler with -v option

The following code:

static int state[(unsigned) (4. / 2)];

int main (int argc, char **argv)
{
    argc = argc; argv = argv;

    state[0] = 1;

    return 0;
}

triggers the above warning.

If I change the declaration to: 
static int state[(unsigned) 4.];

Then the problem does not occur.

Additional information:
a) The compiler is part of Vitis 2023.2 (from AMD - formerly Xilinx)
b) The software runs on a PC under Windows 10 (Version 22H2, OS Build
19045.5247)
c) Compilation target is ARM (64-bit).

Reply via email to