This is the mail archive of the
mailing list for the glibc project.
Re: Add macros for diagnostic control, use for scanf %a tests
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 25 Nov 2014 18:48:03 -0800
- Subject: Re: Add macros for diagnostic control, use for scanf %a tests
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1411252243090 dot 17237 at digraph dot polyomino dot org dot uk> <54752077 dot 7000002 at cs dot ucla dot edu> <alpine dot DEB dot 2 dot 10 dot 1411260040470 dot 17237 at digraph dot polyomino dot org dot uk> <5475349C dot 6040208 at cs dot ucla dot edu> <alpine dot DEB dot 2 dot 10 dot 1411260204030 dot 17237 at digraph dot polyomino dot org dot uk>
Joseph Myers wrote:
I'm doubtful about hiding warnings in ways that rely on the compiler not
being smart enough to see through them ...
An inline wrapper would not be appropriate; these tests are specifically
using arguments with side-effects, and arguments with unusual types
Fair enough on both points, but this underscores the suggestion that for test
cases let's do just put a simple pragma at the start of the file. To grep it
later we can use a stylized comment, like this:
/* (GCC 4.9) gcc -Werror -Wformat fails in C99 mode because ... */
#pragma GCC diagnostic ignored "-Wformat"
as it's not worth our time (or our readers' time) to get fancier on test cases.