@japhir and all: If you get
/opt/.cache/yay/gcc-git/src/gcc/libcpp/expr.c: In function 'unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)':
/opt/.cache/yay/gcc-git/src/gcc/libcpp/expr.c:807:35: error: format not a string literal and no format arguments [-Werror=format-security]
807 | cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
808 | 0, message);
| ~~~~~~~~~~~
/opt/.cache/yay/gcc-git/src/gcc/libcpp/expr.c:810:38: error: format not a string literal and no format arguments [-Werror=format-security]
810 | cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
811 | virtual_location, 0, message);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/.cache/yay/gcc-git/src/gcc/libcpp/expr.c:820:33: error: format not a string literal and no format arguments [-Werror=format-security]
820 | cpp_warning_with_line (pfile, CPP_W_SIZE_T_LITERALS,
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
821 | virtual_location, 0, message);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
/opt/.cache/yay/gcc-git/src/gcc/libcpp/macro.c: In member function 'vaopt_state::update_type vaopt_state::update(const cpp_token*)':
/opt/.cache/yay/gcc-git/src/gcc/libcpp/macro.c:185:26: error: format not a string literal and no format arguments [-Werror=format-security]
185 | cpp_error_at (m_pfile, CPP_DL_ERROR, token->src_loc,
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
186 | vaopt_paste_error);
| ~~~~~~~~~~~~~~~~~~
/opt/.cache/yay/gcc-git/src/gcc/libcpp/macro.c:214:34: error: format not a string literal and no format arguments [-Werror=format-security]
214 | cpp_error_at (m_pfile, CPP_DL_ERROR, token->src_loc,
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215 | vaopt_paste_error);
| ~~~~~~~~~~~~~~~~~~
/opt/.cache/yay/gcc-git/src/gcc/libcpp/macro.c: In function 'cpp_macro* create_iso_definition(cpp_reader*)':
/opt/.cache/yay/gcc-git/src/gcc/libcpp/macro.c:3674:25: error: format not a string literal and no format arguments [-Werror=format-security]
3674 | cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/.cache/yay/gcc-git/src/gcc/libcpp/macro.c:3689:25: error: format not a string literal and no format arguments [-Werror=format-security]
3689 | cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
and finally, as a result
make[2]: Leaving directory '/opt/.cache/yay/gcc-git/src/gcc-build'
make[1]: *** [Makefile:27832: stage1-bubble] Error 2
make[1]: Leaving directory '/opt/.cache/yay/gcc-git/src/gcc-build'
make: *** [Makefile:1012: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
- Just check if
-Werror=format-security
has been enabled in theCFLAGS
of your/etc/makepkg.conf
. If you don't want to edit/etc/makepkg.conf
, just add the line
CFLAGS=${CFLAGS/-Werror=format-security/}
below the already existing CFLAGS
definition in the build()
section of PKGBUILD
, and
CXXFLAGS=${CXXFLAGS/-Werror=format-security/}
after the CXXFLAGS
definition.
See bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100207 for additional details.
Pinned Comments
DAC324 commented on 2021-09-17 08:04 (UTC)
In addition to the jamespharvey20's sticky comment: The current GCC 12 versions are labelled "Experimental" for a reason. Development is ongoing, and there are still significant bugs. Hence, it is not recommended to use GCC 12 as a daily driver or on production systems.
At the moment, it is not even possible to build a working Linux kernel with GCC 12, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101941 .
jamespharvey20 commented on 2017-02-15 04:30 (UTC) (edited on 2017-02-15 11:01 (UTC) by jamespharvey20)