summaryrefslogtreecommitdiff
path: root/include/fortify-headers.h (follow)
AgeCommit message (Collapse)Author
2024-06-15Fix some pointer-arithmetic warningsjvoisin
This should fix the second part of #59
2024-04-24Fix some overlap mismatchjvoisin
This was caught by the following test: ``` int main(void) { char c[32]; memcpy(c, c + 16, 16); } ``` Reported-by: q66
2024-01-13Properly check for builtinsjvoisin
Clang's [documentation](https://clang.llvm.org/docs/LanguageExtensions.html#has-builtin) says: > __has_builtin should not be used to detect support for a builtin macro; use #ifdef instead. So we're now using both, since it's often tedious/non-trivial to find out what is a macro and what is a compiler builtin, across compilers and C versions.
2023-12-27Improve __fh_overlap implementationjvoisin
2023-12-15Rename some macros to be more namespace-friendlyq66
2023-12-15Do not use static inline for C++ to avoid ODR violationsq66
Fixes https://github.com/jvoisin/fortify-headers/issues/31
2023-12-15Remove superfluous includesjvoisin
This should fix #32
2023-10-16Add a check about redefined macrosjvoisin
2023-09-21Properly enable diagnose_as_builtin attributejvoisin
2023-09-20Add tests for compile-time errorsjvoisin
2023-09-11Factorize overlap checks into a macrojvoisin
2023-09-11Add a warning for _FORTIFY_SOURCE>3jvoisin
2023-09-11Add the warn_unused_result attribute to alloc-related functionsjvoisin
2023-08-22Increase portabilityjvoisin
If the compiler doesn't know about `__builtin_trap`, use `abort` instead.
2023-08-21Make use of __diagnose_ifjvoisin
2023-08-21Remove some todo in __bmo's implementationjvoisin
2023-08-20Make use of __diagnose_as_builtinjvoisin
2023-08-20Use pass_dynamic_object_size only for FORTIFY_SOURCE > 2jvoisin
2023-08-20Make use of pass_dynamic_object_size when availablejvoisin
2023-08-20Fix clang buildjvoisin
- s/CLFAGS/CFLAGS/ - provide paths to local includes - sprinkle more __pass_object_size__ - remove a problematic test
2023-07-18Make use of the alloc_size attributejvoisin
2023-07-10Clean up a bit the macro helljvoisin
2023-07-09Add some malloc annotationsjvoisin
2023-07-09Add some `format` annotationsjvoisin
2023-07-09Move a misplaced #endifjvoisin
2023-07-09Improve a bit `size_t*size_t` overflow checksjvoisin
2023-06-25Fix clang supportjvoisin
2023-06-25add initial clang supportDaniel Kolesa
2023-05-30Add some __attribute__((access…)) annotationsjvoisin
See https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html for details
2023-04-13Make use of __builtin_dynamic_object_sizejvoisin
GCC and Clang provide __builtin_dynamic_object_size (see documentation: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html), so we should make use of it when its available.
2016-09-10Bump copyright yearsin
2015-06-04Use the __inline__ keyword instead of __inline to avoid breakageTrutz Behn
Newer compilers default to GNU11, a C11 dialect. Some software however is unprepared for this or has wrong compatibility checks. What happens is that some software will for compatibility with C89 #define inline before inclusion of a standard header, which is undefined behaviour in C99 and above (C99/C11 7.1.2/4), as inline is a keyword. If any libc headers that are then included via #include_next provide an __inline macro definition (current musl does this if C++ or C99 and above is detected) like the following #define __inline inline this results in any __inline token to be preprocessed away. This breaks use of __builtin_va_arg_pack() in our stdio.h at compile-time as it can only be used in always inlined functions. The function attributes __always_inline__ and __gnu_inline__ themselves require an inline specifier on the function to be applied.
2015-06-03Use namespace-safe macro, param and variable namesTrutz Behn
2015-06-03Fix usage of __USER_LABEL_PREFIX__Trutz Behn
The predefined __USER_LABEL_PREFIX__ macro if it is non-empty contains an identifier, not a string literal, thus it needs to be stringified.
2015-05-13Add LICENSE headersin
2015-05-13Add fortify_fn() helper in fortify-headers.hsin