|
| 1 | +/* -*- c++ -*- |
| 2 | + * Copyright (c) 2012-2016 by the GalSim developers team on GitHub |
| 3 | + * https://github.com/GalSim-developers |
| 4 | + * |
| 5 | + * This file is part of GalSim: The modular galaxy image simulation toolkit. |
| 6 | + * https://github.com/GalSim-developers/GalSim |
| 7 | + * |
| 8 | + * GalSim is free software: redistribution and use in source and binary forms, |
| 9 | + * with or without modification, are permitted provided that the following |
| 10 | + * conditions are met: |
| 11 | + * |
| 12 | + * 1. Redistributions of source code must retain the above copyright notice, this |
| 13 | + * list of conditions, and the disclaimer given in the accompanying LICENSE |
| 14 | + * file. |
| 15 | + * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 16 | + * this list of conditions, and the disclaimer given in the documentation |
| 17 | + * and/or other materials provided with the distribution. |
| 18 | + */ |
| 19 | + |
| 20 | +// The boost header files tend to emit lots of warnings, so pretty much any GalSim |
| 21 | +// code that imports boost should import this first to suppress the warnings. |
| 22 | + |
| 23 | +// icpc pretends to be GNUC, since it thinks it's compliant, but it's not. |
| 24 | +// It doesn't understand #pragma GCC |
| 25 | +// Rather, it uses #pragma warning(disable:nn) |
| 26 | +#ifdef __INTEL_COMPILER |
| 27 | + |
| 28 | +// Disable "overloaded virtual function ... is only partially overridden" |
| 29 | +#pragma warning(disable:654) |
| 30 | + |
| 31 | +#else |
| 32 | + |
| 33 | +// The boost unit tests have some unused variables, so suppress the warnings about that. |
| 34 | +// I think pragma GCC was introduced in gcc 4.2, so guard for >= that version |
| 35 | +#if defined(__GNUC__) && __GNUC__ >= 4 && (__GNUC__ >= 5 || __GNUC_MINOR__ >= 2) |
| 36 | +#pragma GCC diagnostic ignored "-Wunused-variable" |
| 37 | +#endif |
| 38 | + |
| 39 | +// Not sure when this was added. Currently check for it for versions >= 4.3 |
| 40 | +#if defined(__GNUC__) && __GNUC__ >= 4 && (__GNUC__ >= 5 || __GNUC_MINOR__ >= 3) |
| 41 | +#pragma GCC diagnostic ignored "-Warray-bounds" |
| 42 | +#endif |
| 43 | + |
| 44 | +#if defined(__GNUC__) && __GNUC__ >= 4 && (__GNUC__ >= 5 || __GNUC_MINOR__ >= 8) |
| 45 | +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" |
| 46 | +#endif |
| 47 | + |
| 48 | +// For 32-bit machines, g++ -O2 optimization in some TMV calculations uses an optimization |
| 49 | +// that is technically not known to not overflow 32 bit integers. In fact, it is totally |
| 50 | +// fine to use, but we need to remove a warning about it in this file for gcc >= 4.5 |
| 51 | +#if defined(__GNUC__) && __GNUC__ >= 4 && (__GNUC__ >= 5 || __GNUC_MINOR__ >= 5) |
| 52 | +#pragma GCC diagnostic ignored "-Wstrict-overflow" |
| 53 | +#endif |
| 54 | + |
| 55 | + |
| 56 | +#ifdef __clang__ |
| 57 | +// Only clang seems to have this |
| 58 | +#if __has_warning("-Wlogical-op-parentheses") |
| 59 | +#pragma GCC diagnostic ignored "-Wlogical-op-parentheses" |
| 60 | +#endif |
| 61 | + |
| 62 | +// And clang might need this even if it claims to be GNUC before 4.8. |
| 63 | +#if __has_warning("-Wunused-local-typedefs") |
| 64 | +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" |
| 65 | +#endif |
| 66 | + |
| 67 | +#endif // clang |
| 68 | + |
| 69 | +#endif // intel |
0 commit comments