summaryrefslogtreecommitdiff
path: root/compiler.h
Commit message (Collapse)AuthorAgeFilesLines
* Fixes some issues with C++11.Fred Wright2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In compiler.h, it adds the missing "std::" namespace prefixes to the memory_barrier() definition. In gpsd.h it: 1) Moves the include of compiler.h outside the conditional 'extern "C"', since the "atomic" stuff in the former is incompatible with the latter. 2) Fixes DEVICEHOOKPATH for C++11 (C++11 requires spaces between literals and string macros). 3) Cleans up some ordering of system includes left over from the former head/tail setup. TESTED: Ran "scons build-all check" on OSX 10.5-10.12, Ubuntu 14, CentOS 7, Fedora 25, FreeBSD 10.3, OpenBSD 5.6 (32- and 64-bit), and NetBSD 6.1.5. Also tested Qt builds with OSX 10.9 (Qt4 and Qt5), OSX 10.12 (Qt5), and Fedora 25 (Qt5). Observed the correct DEVICEHOOKPATH in the log on OSX.
* Clean up stdatomic.h confusion with C++Gary E. Miller2016-01-041-7/+21
| | | | | | | | | | For atomics: C98 and above needs <stdatomic.h> C++11 and above needs <atomic> C++98 and C++03 have no atomics So this leaves a little hole where we have no atomics for C++98 and C++03. So C++ clients need tp be careful...
* Fix incirrect conditionalization.Eric S. Raymond2015-09-161-3/+3
|
* Include <stdatomic.h> only in C mode.Gleb Smirnoff2015-05-151-2/+2
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-5/+1
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* Typo STD_ATOMIC_H -> _STDATOMIC_HHal Murray2015-03-241-1/+1
|
* Add compile-time check for arg type to NITEMS()Zbigniew Chyla2015-03-221-0/+21
| | | | | | | | If a pointer (not array) is passed to NITEMS() macro, gcc will emit compilation warning. The actual check is based on newly added COMPILE_CHECK_IS_ARRAY macro. The change doesn't affect generated binary code.
* Address Savannah bug #44566: Unused variable warnings with -DNDEBUGKurt Schwehr2015-03-171-1/+1
| | | | | | With -Werror -DNDEBUG, these two cases end up failing with unused variables (gcc 4.9 with lots of patches on Linux). The attached patch solves the issue for me, but it's possible that it might be better with the UNUSEDs wrapped in
* splint/cppcheck/coverity prerelease cleanup.Eric S. Raymond2015-03-131-0/+4
|
* Since Windows should have full POSIX now, remove WIN32 port cruft.Eric S. Raymond2015-03-091-4/+0
| | | | It wasn't being used, anyway. There's no Windows port yet.
* OS X, add OSMemoryBarrier() for memory_barrier() portability.Gary E. Miller2015-03-081-0/+6
| | | | Builds fine, untested.
* Move some toolchain settings into compiler.h, all that stuff should live there.Eric S. Raymond2015-03-071-0/+17
|
* Prevent splint from coughing up a hairball.Eric S. Raymond2015-03-071-0/+2
|
* Add explanatory comment.Eric S. Raymond2015-03-061-1/+2
|
* Header inclusion had a typo.Eric S. Raymond2015-03-061-2/+2
|
* Fall back to a GNUism if C11 stdatomic.h is not available but GCC is.Eric S. Raymond2015-03-061-0/+2
| | | | All regression tests pass.
* clang can declare unused for arguments, too.Eric S. Raymond2015-03-021-1/+1
| | | | All regression tests pass with CC=clang.
* Repair inclusion of stdatomic.h.Eric S. Raymond2015-02-281-1/+5
|
* memory_barrier() now uses a standardized C11 lockless-concurrency primitive.Eric S. Raymond2015-02-261-5/+5
| | | | All regression tests pass.
* Concurrency protection for ntpmon using memory barrier instructions.Eric S. Raymond2015-02-251-0/+18
|
* Add compiler.h with compiler specific macros.Zbigniew Chyla2015-01-211-0/+25
Use new macros (UNUSED, PRINTF_FUNC) where appropriate. This change doesn't affect generated binary code.