Lessons learned from compiler error/warnings tests

Martin Sebor msebor@gmail.com
Fri Sep 9 17:15:00 GMT 2016


On 09/09/2016 06:28 AM, Florian Weimer wrote:
> For compile-time fortify checks (such as the wrappers for type-safe
> open/openat), we need to add tests in glibc which examine the compiler
> output for warnings and errors.
>
> I do not want to add Dejagnu as a dependency to the glibc test suite,
> but I wonder if you could share any lessons learned from the testing
> support facility in GCC.
>
> Would you suggest to mirror the GCC directives exactly?
>
> I probably have to implement the testing directive parser as a small C
> program.

Writing a parser in C or C++ or other high level language wouldn't
be my first (or second) choice.  If all I needed to do is check for
compiler errors and warnings on the source lines  they point to, my
first choice would be a POSIX shell script combined with grep, sed,
and/or awk.

Martin



More information about the Libc-alpha mailing list