summaryrefslogtreecommitdiff
path: root/m4/dpkg-compiler.m4
AgeCommit message (Collapse)AuthorFilesLines
2019-10-30build: Add a serial versioning to the m4 filesGuillem Jover1-0/+1
aclocal uses this to determine whether it needs to update m4 files in local trees.
2018-03-26Use internerr() or BUG() instead of assert()Guillem Jover1-0/+1
The problem with assert() is that it does not print the contents of the variables. It also can be disabled on NDEBUG. But we always want these consistency checks no matter what, and they are not performance sensitive anyway. Enable -Wno-nonnull-compare so that we can keep doing run-time non-NULL checks in functions, instead of just compile-time checks.
2018-03-25build: Enable gcc-7 -Wregister warning if availableGuillem Jover1-0/+1
2018-03-25build: Enable clang -Wdocumentation warning if availableGuillem Jover1-0/+1
Fix a couple of function parameter typos surfaced by the new warning. Warned-by: clang
2018-03-25build: Sort warning optionsGuillem Jover1-18/+19
This makes it easier to add new ones without accidentally adding duplicates.
2018-03-25build: Automatically replace -Wno- with -W when testing compiler flagsGuillem Jover1-6/+4
This is less error prone, less repetitive and the correct thing to do ayway. Instead of manually passing the positive form for these flags.
2017-05-20build: Add new gcc-7 warningsGuillem Jover1-0/+2
2016-10-29build: Check the availability of -Wpositive variant instead of -Wno-positiveGuillem Jover1-4/+8
At least gcc and clang do not warn on -Wno-* warning flags, only when something else needs to be reported, which defeats our test. In those cases pass an additional argument that will be what we will actually check, but not use afterwards.
2016-10-29build: Disable -Wtautological-constant-out-of-range-compareGuillem Jover1-0/+1
This emits a false positive for the test suite. Warned-by: clang
2016-10-29build: Fix M4sh/Autoconf coding styleGuillem Jover1-23/+22
Indent the code in a way that makes it easier to follow. Use AS_IF instead of shell constructs. Quote all autoconf macro arguments. Add a new section to coding-style.txt describing M4sh/Autoconf.
2016-10-29build: Clean up compiler and linker automatic flag usageGuillem Jover1-13/+14
Detect if the flags work at configure time, instead of enabling them unconditionally. Amend the description so that the above is clear. And rename the options so that downstreams realize about the change.
2016-02-26build: Add new gcc-6 warningsGuillem Jover1-0/+2
2015-01-28build: Add new gcc 5 warningsGuillem Jover1-0/+4
Warn on features not present in ISO C99 but present in ISO C11, on sizeof for an array argument, on switch keyword with bool values, and logical not on the left handside of a comparison.
2015-01-28build: Check for -Wformat-security with -WformatGuillem Jover1-1/+1
This flag does not work anymore in gcc 5 w/o also passing -Wformat.
2015-01-28build: Rework DPKG_C_C99 macro to define HAVE_C_C99 just onceGuillem Jover1-23/+30
Use the opportunity to fix the indentation.
2014-10-06build: Fix compiler flag detection with non-GCC compilersGuillem Jover1-1/+1
We enable -Werror when checking the flags so that on compilers like clang which just emit a warning on unknown warning options, instead of erroring out, we get proper detection. We could just use stuff like -Werror=unknown-warning-option and -Werror=unused-command-line-argument, but then we would need to detect if those are available as they might make the compiler error out if they are no supported. So just using the blanket -Werror, although more broad, makes the code less complicated.
2014-08-09build: Refactor compiler option checks into a new functionGuillem Jover1-78/+77
2014-06-04build: Uppercase enum in C99 test codeGuillem Jover1-2/+2
2014-04-21build: Test for required compound literalsGuillem Jover1-1/+5
And clarify the comment on the designated initializers.
2013-12-05dselect: Use C++11 nullptr instead of 0 or NULLGuillem Jover1-0/+49
It is way more descriptive, and has a better type. Check for C++11 compiler support and fallback nullptr to 0 if unavailable.
2013-12-05build: Reword C99 compiler check outputGuillem Jover1-2/+2
Specify the current compiler being used, and shorten the message checking for an option to enable C99 support.
2013-12-05build: Check availability of warning flags at build timeGuillem Jover1-14/+78
This fixes a build failure with old g++ compilers not accepting -Wc++11-compat.
2013-10-27build: Add -Wc++11-compat and -Wlogical-op to the dafault warningsGuillem Jover1-2/+2
2013-10-27build: Remove -Wno-unused-value from default CXXFLAGSGuillem Jover1-2/+1
The ncurses bug (#542031) has long been fixed.
2011-03-14build: Check for %j and %z format modifiers supportGuillem Jover1-0/+12
We use those to create binary output, so we require them to be working.
2011-03-14build: Add -Wformat-security and -Wpointer-arith to default warningsGuillem Jover1-0/+1
2010-11-19Cleanup white spacesGuillem Jover1-1/+0
Remove trailing spaces. Remove blank lines not separating different code blocks. Remove blank lines at the end of the file.
2010-11-19Cleanup and improve source code commentsGuillem Jover1-6/+6
Global review, which includes the following changes to try to increase consistency, update and improve the source code comments: - Spelling fixes. - Use American English forms. - Uppercase NULL, NUL and ASCII. - Use “Note: ” instead of the slightly cryptic “NB: ” form. - Write comments as proper sentences, including capitalizations and ending dots. - Move comments before the code, function or variable they refer to. - Move general function comments outside the body. - Convert function and variable description comments to doxygen. - Use one space before dot, exclamation and question marks. - Use ‘’ or “” instead of `' style quoting. - Remove author names from comments, already visible from “git blame”. - Mark strings for translators with “TRANSLATORS: ”. - Remove useless or outdated comments. - Fix comment indentation. - Standardize comment format: /* Short text comment. */ /* Long text, * comment. */ /* * Section text. */
2010-11-19build: Unify and fix AC_ARG_ENABLE usageGuillem Jover1-4/+7
The current code was executing code in the action arguments, instead of just setting boolean flags and processing them afterwards. This poses several problems, it implies jugling code around in case the the default changes, it might also duplicate code, and it might leave the ACTION-IF-NOT-GIVEN argument empty which could turn into an empty “then fi” shell block which is a syntax error on POSIX shell. Leaving the ACTION-IF-GIVEN argument empty is fine as it's always used by autoconf to set $enableval to the specific enable variable, and setting that variable from $enableval is redundant and might be wrong depending on the order they are set, which could empty it. Reported-by: Michael Schmidt <michael.schmidt.dangel@gmail.com>
2010-11-19build: Add missing m4 quotes to sed regexGuillem Jover1-1/+1
This was making the regex non-functional, as the square brackets were being removed when generating the output file, thus making the --disable-compiler-optimisations and --disable-linker-optimisations non-functional.
2010-07-16build: Add -Wshadow to default warningsGuillem Jover1-1/+1
2010-06-07build: Enable additional warnings by defaultGuillem Jover1-6/+8
The set of default warnings is quite safe, and should point out real problems or stylistic ones. It's easy to forget, so let's enable them by default. This will also not interfere with user settings as those will override the defaults.
2010-03-13libdpkg: Use __attribute__ keyword depending on compiler supportGuillem Jover1-17/+0
Check for compiler support from preprocessor macros and selectively enable specific __attribute__ specifications. We avoid exposing the configure variable HAVE_C_ATTRIBUTE, which was never defined for the installed headers. Remove the now unused DPKG_C_ATTRIBUTE autoconf macro.
2010-02-19build: Add more warnings to --enable-compiler-warningsGuillem Jover1-3/+9
2010-01-01Add missing copyright statementsGuillem Jover1-1/+2
2009-10-29build: Rename and namespace dpkg m4 filesGuillem Jover1-0/+107
This avoids possible future collisions and makes it easier to see what's coming from dpkg and what each file is for.