mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Bug 20729: Fix building with -Os.
This commit adds a new DIAG_IGNORE_Os_NEEDS_COMMENT which is only enabled when compiling with -Os. This allows developers working on -Os enabled builds to mark false-positive warnings without impacting the warnings emitted at -O2. Then using the new DIAG_IGNORE_Os_NEEDS_COMMENT we fix 6 warnings generated with GCC 5 to get -Os builds working again.
This commit is contained in:
@ -111,4 +111,19 @@ extern __typeof (__profile_frequency) __profile_frequency attribute_hidden;
|
||||
#define DIAG_IGNORE_NEEDS_COMMENT(version, option) \
|
||||
_Pragma (_DIAG_STR (GCC diagnostic ignored option))
|
||||
|
||||
/* Similar to DIAG_IGNORE_NEEDS_COMMENT the following macro ignores the
|
||||
diagnostic OPTION but only if optimizations for size are enabled.
|
||||
This is required because different warnings may be generated for
|
||||
different optimization levels. For example a key piece of code may
|
||||
only generate a warning when compiled at -Os, but at -O2 you could
|
||||
still want the warning to be enabled to catch errors. In this case
|
||||
you would use DIAG_IGNORE_Os_NEEDS_COMMENT to disable the warning
|
||||
only for -Os. */
|
||||
#ifdef __OPTIMIZE_SIZE__
|
||||
# define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option) \
|
||||
_Pragma (_DIAG_STR (GCC diagnostic ignored option))
|
||||
#else
|
||||
# define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
|
||||
#endif
|
||||
|
||||
#endif /* _LIBC_INTERNAL */
|
||||
|
Reference in New Issue
Block a user