__UINT_LEAST8_MAX__ and HP-UX 11.23/IA

Albert Chin <[email protected]>
Newsgroups gmane.comp.parsers.bison.bugs
Message-ID <[email protected]>
In data/skeletons/c.m4 from bison-3.7.4, we have:
  #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
  typedef __UINT_LEAST8_TYPE__ yytype_uint8;
  #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
         && UINT_LEAST8_MAX <= INT_MAX)
  typedef uint_least8_t yytype_uint8;
  #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
  typedef unsigned char yytype_uint8;
  #else
  typedef short yytype_uint8;
  #endif

Unfortunately, on HP-UX 11.23/IA, UINT_LEAST8_MAX evaluates to
((unsigned char)(255)) causing a problem with:
  #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
         && UINT_LEAST8_MAX <= INT_MAX)

While building sudo-1.9.5p1 which uses bison-3.7.2, we get errors
like:
  "gram.c", line 510: error #2018: expected a ")"
           && UINT_LEAST8_MAX <= INT_MAX)
              ^

  "gram.c", line 510: error #2059: function call is not allowed in a constant
            expression
           && UINT_LEAST8_MAX <= INT_MAX)
              ^

So, what's the best way to solve this?

-- 
albert chin ([email protected])
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.