Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distcc 3.2rc1 compiler warnings on Windows/Cygwin #125

Open
GoogleCodeExporter opened this issue May 26, 2015 · 0 comments
Open

distcc 3.2rc1 compiler warnings on Windows/Cygwin #125

GoogleCodeExporter opened this issue May 26, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Compiling distcc3.2rc1 on Windows/Cygwin causes some compiler warnings of the 
following form:

cc1: warnings being treated as errors
../src/gcc-id.c: In function ‘strip_bad_chars’:
../src/gcc-id.c:45:13: error: array subscript has type ‘char’
Makefile:448: recipe for target `src/gcc-id.o' failed

The problem with these warnings is that they are treated as errors by default 
(unless --disable-Werror is passed to configure)

The following macros are involved (copied from ctype.h):

#   define tolower(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);    \
      isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;})

#define isupper(__c)    ((__ctype_lookup(__c)&(_U|_L))==_U)

/* These macros are intentionally written in a manner that will trigger
   a gcc -Wall warning if the user mistakenly passes a 'char' instead
   of an int containing an 'unsigned char'.  Note that the sizeof will
   always be 1, which is what we want for mapping EOF to __ctype_ptr__[0];
   the use of a raw index inside the sizeof triggers the gcc warning if
   __c was of type char, and sizeof masks side effects of the extra __c.
   Meanwhile, the real index to __ctype_ptr__+1 must be cast to int,
   since isalpha(0x100000001LL) must equal isalpha(1), rather than being
   an out-of-bounds reference on a 64-bit machine.  */
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])


Unfortunately, I don't understand what should be wrong with the distcc source 
code. Maybe someone else has a clue what's wrong (a cygwin/newlib bug?). IMHO 
it would be nice to fix this issue in order to make a "./configure && make && 
make install" work on cygwin.

Original issue reported on code.google.com by zull...@gmail.com on 24 Feb 2013 at 10:32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant