Skip to content

Commit 870ae2a

Browse files
authored
Fix typo in __GNUC_PREREQ__ version check (#1086)
__GNUC_MINOR__ was missing a trailing underscore, which prevented __builtin_expect() from being used via __predict_false() in the error path of checked functions like __memcpy_chk(). __builtin_expect is defined from GCC 3 (2001) and Clang 2.2 (2008). Signed-off-by: Tiago de Paula <tiagodepalves@gmail.com>
1 parent 07cd9c3 commit 870ae2a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common/inc/tlibc/sys/cdefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
/*
5858
* Macro to test if we're using a specific version of gcc or later.
5959
*/
60-
#if defined __GNUC__ && defined __GNUC_MINOR_
60+
#if defined __GNUC__ && defined __GNUC_MINOR__
6161
# define __GNUC_PREREQ__(ma, mi) \
6262
((__GNUC__ > (ma)) || (__GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)))
6363
#else

0 commit comments

Comments
 (0)