Wireshark mailing list archives
Re: GCC Diagnostic Pragmas
From: Alexis La Goutte <alexis.lagoutte () gmail com>
Date: Sun, 10 Nov 2013 11:35:02 +0100
On Sat, Nov 9, 2013 at 1:39 PM, Jakub Zawadzki <darkjames-ws () darkjames pl>wrote:
Hi, In few dissectors we're manually disabling some kind of warnings, like in packet-parlay.c #ifdef _MSC_VER /* disable warning: "unreference local variable" */ #pragma warning(disable:4101) #endif It's possible to do the same with GCC (4.6) using diagnostics pragmas[1]. Googling around found test: #if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6 || __APPLE_CC__)) # pragma GCC diagnostic ignored "-Wunused" #endif which seems to be not working with my clang-3.3. qemu does test during configure, trying to compile some test program with -Werror. I think we could do the same, test program can looks like this: #v+ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused" #pragma GCC diagnostic pop int main(void) { return 0; } #v- OK? [1] http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html
Hi Jakub, No problem for me ! There is some pragma stuff in epan/wsgcrypt.h (i not sure if the hack for Clang works). I plan also to add some pragma (file) to Wireshark (to fix the compilation when run with -Wdocumentation...) Regards,
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org ?subject=unsubscribe
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- GCC Diagnostic Pragmas Jakub Zawadzki (Nov 09)
- Re: GCC Diagnostic Pragmas Alexis La Goutte (Nov 10)
- Re: GCC Diagnostic Pragmas Jakub Zawadzki (Nov 10)
- Re: GCC Diagnostic Pragmas Alexis La Goutte (Nov 10)