Code changes to fix the warnings/errors when building the application in the usr.bin/mandoc folder
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Changelog:
Pre-fix warnings located at: https://gist.github.com/aprieger-llnw/53047c8a5d6eb6c28281e41a30e7d1da
- contrib/mdocml/main.c
- warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration]
- fix: defined _WITH_GETLINE on line 37 to allow the 'getline' function to be used with POSIX, according to the FreeBSD manual
- warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration]
- contrib/mdocml/mandocdb.c
- warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration]
- fix: defined _WITH_GETLINE on line 43 to allow the 'getline' function to be used with POSIX, according to the FreeBSD manual
- warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration]
- contrib/mdocml/manpath.c
- warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration]
- fix: defined _WITH_GETLINE on line 28 to allow the 'getline' function to be used with POSIX, according to the FreeBSD manual
- warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration]
Comment Actions
As of rS303524 (July 2016), _WITH_GETLINE is no longer checked by stdio.h. Therefore, there are two possibilities:
- either the source code being built does not have the change rS303524, and working around it is inappropriate;
- or the system running the build does not have the change and the warnings occur during the bootstrap-tools phase of the build (building a makewhatis binary for use during the build itself). In this case, it seems more appropriate to add -D_WITH_GETLINE to some kind of compiler flags specific to bootstrap tools, so that this workaround can be removed eventually and no conflicts can be caused with upstream changes. Alternatively, the warning during bootstrap-tools could be ignored.