C DIALECT
- Some C99 features are OK because they are widely implemented:
+ Most C99 features are OK because they are widely implemented:
* Flexible array members (e.g. struct { int foo[]; }).
* Designated initializers (e.g. "struct foo foo = {.a = 1};" and
"int a[] = {[2] = 5};").
- Don't use other C99 features that are not widely implemented in
-older compilers:
+ * Mixing of declarations and code within a block. Please use this
+ judiciously; keep declarations nicely grouped together in the
+ beginning of a block if possible.
- * Don't mix declarations and code within a block.
-
- * Don't use declarations in iteration statements (e.g. don't write
+ * Use of declarations in iteration statements (e.g.
"for (int i = 0; i < 10; i++)").
- * Don't put a trailing comma in an enum declaration (e.g. don't
- write "enum { x = 1, };").
+ * Use of a trailing comma in an enum declaration (e.g.
+ "enum { x = 1, };").
As a matter of style, avoid // comments.
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([_OVS_CHECK_CC_OPTION], [dnl
- m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-], [_])])dnl
+ m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-=], [__])])dnl
AC_CACHE_CHECK([whether $CC accepts $1], [ovs_cv_name],
[ovs_save_CFLAGS="$CFLAGS"
dnl Include -Werror in the compiler options, because without -Werror
OVS_ENABLE_OPTION([-Wextra])
OVS_ENABLE_OPTION([-Wno-sign-compare])
OVS_ENABLE_OPTION([-Wpointer-arith])
-OVS_ENABLE_OPTION([-Wdeclaration-after-statement])
OVS_ENABLE_OPTION([-Wformat-security])
OVS_ENABLE_OPTION([-Wno-format-zero-length])
OVS_ENABLE_OPTION([-Wswitch-enum])