Disable clang's -Wunreachable-code warning

This commit is contained in:
Nigel Tao committed 2020-04-03 21:57:49 +11:00
1 parent ecd3285567
commit 1a1f36ce13
4 files changed
+35 -43

No files matched your search

+12 -20
View File
@@ -8,6 +8,14 @@
// "foo.h"-like header, #define WUFFS_IMPLEMENTATION before #include'ing or
// compiling it.
// Wuffs' C code is generated automatically, not hand-written. These warnings'
// costs outweigh the benefits.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunreachable-code"
#pragma clang diagnostic ignored "-Wunused-function"
#endif
// Copyright 2017 The Wuffs Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,12 +34,6 @@
#include <stdint.h>
#include <string.h>
// GCC does not warn for unused *static inline* functions, but clang does.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -4205,10 +4207,6 @@ struct wuffs_base__token_decoder__struct {
} // extern "C"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -6716,12 +6714,6 @@ struct wuffs_zlib__decoder__struct {
// WUFFS C HEADER ENDS HERE.
#ifdef WUFFS_IMPLEMENTATION
// GCC does not warn for unused *static inline* functions, but clang does.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -10524,10 +10516,6 @@ wuffs_base__ascii__longest_valid_prefix(wuffs_base__slice_u8 s) {
} // extern "C"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#if !defined(WUFFS_CONFIG__MODULES) || defined(WUFFS_CONFIG__MODULE__ADLER32)
// ---------------- Status Codes Implementations
@@ -24322,4 +24310,8 @@ exit:
#endif // WUFFS_IMPLEMENTATION
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // WUFFS_INCLUDE_GUARD