https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107611
Bug ID: 107611 Summary: mc-boot-ch/Gtermios.cc etc. don't compile on Mac OS X 10.7 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: ro at gcc dot gnu.org Target Milestone: --- Host: x86_64-apple-darwin11.4.2 Target: x86_64-apple-darwin11.4.2 Build: x86_64-apple-darwin11.4.2 Created attachment 53867 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53867&action=edit Proposed patch When trying to build the current devel/modula-2 branch on Mac OS X 10.7, it failed to compile mc-boot-ch/Gtermios.cc, pge-boot/Gtermios.cc, and gm2-libs-ch/termios.c: /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/Gtermios.cc: In function 'int termios_SetFlag(termios*, Flag, int)': /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/Gtermios.cc:1091:26: error: cannot convert 'tcflag_t*' {aka 'long unsigned int*'} to 'unsigned int*' 1091 | return doSetUnset (&t->c_iflag, IGNBRK, b); | ^~~~~~~~~~~ | | | tcflag_t* {aka long unsigned int*} /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/Gtermios.cc:168:27: note: initializing argument 1 of 'int doSetUnset(unsigned int*, unsigned int, int)' 168 | doSetUnset (unsigned int *bitset, unsigned int mask, int value) | and many more instances of the same. As the error says, tcflag_t is unsigned long on that Darwin version. The fix is easy: just don't make doSetUnset assume the type of tcflag_t, but use the correct type directly. This is what the attached patch does, which allows the build to continue.