Skip to content

Commit 399d84d

Browse files
committed
build: Only allow ASCII identifiers
While emoji and other symbols in C++ identifers (as accepted by newer compilers) are fun, they might create confusion during code review, for example because some symbols look very similar. Forbid such extended identifiers for now. This is done by providing `-fno-extended-identifiers`. Thanks to sipa for suggesting this compiler flag.
1 parent ea3e9e0 commit 399d84d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
422422
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
423423
fi
424424

425+
dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
426+
AX_CHECK_COMPILE_FLAG([-fno-extended-identifiers],[[CXXFLAGS="$CXXFLAGS -fno-extended-identifiers"]],,[[$CXXFLAG_WERROR]])
427+
425428
enable_sse42=no
426429
enable_sse41=no
427430
enable_avx2=no

0 commit comments

Comments
 (0)