ndless-nspire / Ndless

The TI-Nspire calculator extension for native applications
http://ndless.me
856 stars 104 forks source link

Downloaded version of GCC produces an error #423

Closed myclevorname closed 3 months ago

myclevorname commented 3 months ago

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 commented 3 months ago

This could solve it? https://github.com/ndless-nspire/Ndless/pull/420

myclevorname commented 3 months ago

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 commented 3 months ago

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

myclevorname commented 3 months ago

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