Skip to content

Commit c540479

Browse files
DanAlbertstephensmalley
authored andcommitted
Global C++11 compatibility.
Our build system compiles flex/bison as C++ rather than C, but a few projects add `-x c` to their flags, forcing the compiler to compile them as C. This causes the compiler to reject the global C++ standard flag, so we need to explicitly provide a C standard flag to override it. Bug: 18466763 Change-Id: I49a6aeecf4abc563bd77127778b6d214e3851037 Signed-off-by: Stephen Smalley <[email protected]>
1 parent 3f12115 commit c540479

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

checkpolicy/Android.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ common_includes := \
2323
$(LOCAL_PATH)/../libsepol/src/ \
2424

2525
##
26-
# "-x c" forces the lex/yacc files to be compiled as c
27-
# the build system otherwise forces them to be c++
28-
yacc_flags := -x c
26+
# "-x c" forces the lex/yacc files to be compiled as c the build system
27+
# otherwise forces them to be c++. Need to also add an explicit -std because the
28+
# build system will soon default C++ to -std=c++11.
29+
yacc_flags := -x c -std=gnu89
2930

3031

3132
##

0 commit comments

Comments
 (0)