Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloaded version of GCC produces an error #423

Closed
myclevorname opened this issue Jul 28, 2024 · 4 comments
Closed

Downloaded version of GCC produces an error #423

myclevorname opened this issue Jul 28, 2024 · 4 comments
Labels

Comments

@myclevorname
Copy link

myclevorname commented Jul 28, 2024

I am running NixOS unstable with GCC version 13.3.0. When building, I get the error shown below. Please update the version of GCC used.

...
gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../download/gcc-11.2.0/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE -fcf-protection ../../download/gcc-11.2.0/libiberty/bsearch_r.c -o bsearch_r.o
g++  -I../../../download/gcc-11.2.0/libcpp -I. -I../../../download/gcc-11.2.0/libcpp/../include -I../../../download/gcc-11.2.0/libcpp/include  -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I../../../download/gcc-11.2.0/libcpp -I. -I../../../download/gcc-11.2.0/libcpp/../include -I../../../download/gcc-11.2.0/libcpp/include    -c -o errors.o -MT errors.o -MMD -MP -MF .deps/errors.Tpo ../../../download/gcc-11.2.0/libcpp/errors.c
g++  -I../../../download/gcc-11.2.0/libcpp -I. -I../../../download/gcc-11.2.0/libcpp/../include -I../../../download/gcc-11.2.0/libcpp/include  -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I../../../download/gcc-11.2.0/libcpp -I. -I../../../download/gcc-11.2.0/libcpp/../include -I../../../download/gcc-11.2.0/libcpp/include    -c -o expr.o -MT expr.o -MMD -MP -MF .deps/expr.Tpo ../../../download/gcc-11.2.0/libcpp/expr.c
../../../download/gcc-11.2.0/libcpp/expr.c: In function ‘unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)’:
../../../download/gcc-11.2.0/libcpp/expr.c:811:35: error: format not a string literal and no format arguments [-Werror=format-security]
  811 |             cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
      |             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  812 |                                    0, message);
      |                                    ~~~~~~~~~~~
../../../download/gcc-11.2.0/libcpp/expr.c:814:38: error: format not a string literal and no format arguments [-Werror=format-security]
  814 |             cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
  815 |                                       virtual_location, 0, message);
      |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../download/gcc-11.2.0/libcpp/expr.c:824:33: error: format not a string literal and no format arguments [-Werror=format-security]
  824 |           cpp_warning_with_line (pfile, CPP_W_SIZE_T_LITERALS,
      |           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  825 |                                  virtual_location, 0, message);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++  -I../../../download/gcc-11.2.0/libcpp -I. -I../../../download/gcc-11.2.0/libcpp/../include -I../../../download/gcc-11.2.0/libcpp/include  -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I../../../download/gcc-11.2.0/libcpp -I. -I../../../download/gcc-11.2.0/libcpp/../include -I../../../download/gcc-11.2.0/libcpp/include    -c -o files.o -MT files.o -MMD -MP -MF .deps/files.Tpo ../../../download/gcc-11.2.0/libcpp/files.c
...
@adriweb
Copy link
Contributor

adriweb commented Jul 28, 2024

This could solve it? #420

@myclevorname
Copy link
Author

This could solve it? #420

That did not fix it.

...
ndless-sdk> checking for suffix of executables... ../../download/gcc-14.1.0/libcpp/expr.cc: In function 'unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)':
ndless-sdk> ../../download/gcc-14.1.0/libcpp/expr.cc:842:35: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;]
ndless-sdk>   842 |             cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
ndless-sdk>       |             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk>   843 |                                    0, message);
ndless-sdk>       |                                    ~~~~~~~~~~~
ndless-sdk> ../../download/gcc-14.1.0/libcpp/expr.cc:845:38: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;]
ndless-sdk>   845 |             cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
ndless-sdk>       |             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk>   846 |                                       virtual_location, 0, message);
ndless-sdk>       |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk> ../../download/gcc-14.1.0/libcpp/expr.cc:855:33: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;]
ndless-sdk>   855 |           cpp_warning_with_line (pfile, CPP_W_SIZE_T_LITERALS,
ndless-sdk>       |           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk>   856 |                                  virtual_location, 0, message);
ndless-sdk>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk> ../../download/gcc-14.1.0/libcpp/expr.cc:867:42: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;]
ndless-sdk>   867 |                 cpp_pedwarning_with_line (pfile, CPP_W_C11_C23_COMPAT,
ndless-sdk>       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk>   868 |                                           virtual_location, 0, message);
ndless-sdk>       |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk> ../../download/gcc-14.1.0/libcpp/expr.cc:870:39: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;]
ndless-sdk>   870 |                 cpp_warning_with_line (pfile, CPP_W_C11_C23_COMPAT,
ndless-sdk>       |                 ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk>   871 |                                        virtual_location, 0, message);
ndless-sdk>       |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk> ../../download/gcc-14.1.0/libcpp/expr.cc:877:35: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;]
ndless-sdk>   877 |               cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
ndless-sdk>       |               ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndless-sdk>   878 |                                    message);
ndless-sdk>       |                                    ~~~~~~~~
ndless-sdk> gcc -c -g -O2    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I../../download/gcc-14.1.0/fixincludes -I../include -I../../download/gcc-14.1.0/fixincludes/../include ../../download/gcc-14.1.0/fixincludes/fixfixes.c
...

@Vogtinator
Copy link
Contributor

I guess your environment sets incompatible CFLAGS/CXXFLAGS. Make sure those variables are not set.

@myclevorname
Copy link
Author

I found the problem. I had to add hardeningDisable = [ "format" ]; into my Flake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants