Unused local typedef
When building with gcc 4.8.2, this error appears:
In file included from /dpool/export/home/mills/Downloads/code/illumos-gate/proto/root_sparc/usr/include/fcntl.h:40:0,
../screen/tgetch.c: In function '_fpk':
/dpool/export/home/mills/Downloads/code/illumos-gate/proto/root_sparc/usr/include/sys/fcntl.h:213:3: error: typedef 'flock_t' locally defined but not used [-Werror=unused-local-typedefs]
The solution is to remove the unused local typedefs. For gcc 4.8.2, the error can be suppressed by adding this line to Makefile or Makefile.com, with the group of similar lines:
CERRWARN += -_gcc=-Wno-unused-local-typedefs
This error occurs in two locations: usr/src/lib/libnsl/sparc and usr/src/lib/libcurses .
Updated by Gary Mills over 5 years ago
- File tgch.diff tgch.diff added
- File tyd.diff tyd.diff added
- Status changed from New to Feedback
- % Done changed from 0 to 30
Yes, moving the include statement fixed the problem. They must have been economizing on conditionals. There were actually two files affected: ../screen/tgetch.c ../screen/typeahead.c . I moved the include statements to the top and wrapped them in appropriate conditionals. Then I no longer needed to add `-_gcc=-Wno-unused-local-typedefs' to Makefile.com to suppress the error. I'm attaching both new patch files.