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 other/82784] New: Remove semicolon after "do {} while (0)" macros


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

            Bug ID: 82784
           Summary: Remove semicolon after "do {} while (0)" macros
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Wrapping a multi-statement macro body in "do {} while (0)" in order to use the
macro as a single-statement entity only works if the macro body is not
terminated with a semicolon.

However, that still seems to happen, f.i.:
...
$ egrep -d skip 'while \((0|false)\);' gcc/*
gcc/asan.c:  } while (0);
gcc/defaults.h:  } while (0);
gcc/graphite-scop-detection.c:    } while (0);
gcc/print-rtl-function.c:  } while (0);
gcc/read-rtl-function.c:  } while (0);
gcc/reload.c:  while (0);
...

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