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

            Bug ID: 102164
           Summary: -Wtype-limits warnings in ada.h
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Recent Ada builds have been showing a number of -Wtype-limits warnings, all
pointing to invocations of the same macro (below).  The warnings don't cause
the build to fail but it would be nice to avoid them just the same.  Maybe by
casting the operands to signed if all their values are in range?

In file included from /src/gcc/master/gcc/ada/gcc-interface/decl.c:39:
ada/einfo.h: In function β€˜B Is_Void_Or_Type(E)’:
/src/gcc/master/gcc/ada/gcc-interface/ada.h:70:13: warning: comparison of
unsigned expression >= 0 is always true [-Wtype-limits]
   (((VALUE) >= (SUBTYPE) CAT (SUBTYPE,__First)) \
ada/einfo.h:1775:13: note: in expansion of macro β€˜IN’
    { return IN (Ekind (Id), Void_Or_Type_Kind); }
             ^~

Reply via email to