public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ron Zamir <zamir.ron@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: errors building gcc-10.2
Date: Mon, 10 Aug 2020 04:01:28 +0300	[thread overview]
Message-ID: <CAORg4NKxvWiPbrjYT0PuLCH17x=8-Ocm9cUZRkPgTNconRnmsQ@mail.gmail.com> (raw)

trying to build gcc-10.2
I've added the latest sources for the GMP, MPFR, MPC, ISL libraries
My system is CentOS 7.8 with gcc version 4.85

I'm running configure with the following parameters:
CC=/usr/bin/gcc CXX=/usr/bin/g++ ../gcc-10.2.0/configure
CFLAGS="-std=gnu99" CXXFLAGS="-std=c++11" --prefix=$HOME/.local/gcc-10
--disable-multilib

the additional CFLAGS and CXXFLAGS parameters where added to try to fix the
error (below)

when I run make, I get the error:
libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I.
-I../../../gcc-10.2.0/gmp/mpn -I.. -D__GMP_WITHIN_GMP
-I../../../gcc-10.2.0/gmp -DOPERATION_compute_powtab -DNO_ASM -g -c
compute_powtab.c -o compute_powtab.o
compute_powtab.c: In function 'mpn_compute_powtab_mul':
compute_powtab.c:142:3: error: 'for' loop initial declarations are only
allowed in C99 mode
   for (long pi = start_idx; pi >= 0; pi--)
   ^
compute_powtab.c:142:3: note: use option -std=c99 or -std=gnu99 to compile
your code
compute_powtab.c: In function 'mpn_compute_powtab_div':
compute_powtab.c:226:3: error: 'for' loop initial declarations are only
allowed in C99 mode
   for (long pi = n_pows - 1; pi >= 0; pi--)
   ^
compute_powtab.c:274:13: error: redefinition of 'pi'
   for (long pi = n_pows; pi >= 0; pi--)
             ^
compute_powtab.c:226:13: note: previous definition of 'pi' was here
   for (long pi = n_pows - 1; pi >= 0; pi--)
             ^
compute_powtab.c:274:3: error: 'for' loop initial declarations are only
allowed in C99 mode
   for (long pi = n_pows; pi >= 0; pi--)
   ^
compute_powtab.c: In function 'powtab_decide':
compute_powtab.c:296:3: error: 'for' loop initial declarations are only
allowed in C99 mode
   for (size_t pn = (un + 1) >> 1; pn != 1; pn = (pn + 1) >> 1)
   ^
compute_powtab.c:304:10: error: redefinition of 'pn'
   size_t pn = un - 1;
          ^
compute_powtab.c:296:15: note: previous definition of 'pn' was here
   for (size_t pn = (un + 1) >> 1; pn != 1; pn = (pn + 1) >> 1)
               ^
compute_powtab.c:308:3: error: 'for' loop initial declarations are only
allowed in C99 mode
   for (long i = n_pows - 2; i >= 0; i--)
   ^
make[5]: *** [compute_powtab.lo] Error 1

what flags should I specify to fix this error?

             reply	other threads:[~2020-08-10  1:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10  1:01 Ron Zamir [this message]
2020-08-10  6:44 ` Marc Glisse
2020-08-10 23:53 ` Jim Wilson
2020-08-11  0:01   ` Ron Zamir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAORg4NKxvWiPbrjYT0PuLCH17x=8-Ocm9cUZRkPgTNconRnmsQ@mail.gmail.com' \
    --to=zamir.ron@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).