https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105388

            Bug ID: 105388
           Summary: [12 regression] Conflicting trunc decls in
                    mc-boot/Gdecl.c etc. on Solaris
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
            Target: *-*-solaris2.11

When building the devel/modula-2 branch as of

commit 6ac8c270eda44fc51104f450f35f91f2705e0c9f
Author: Gaius Mulley <gaius.mul...@southwales.ac.uk>
Date:   Sat Apr 23 12:43:18 2022 +0100

    PR-102342 - fixes to allow gm2 testsuite to work with multilib and extra
gcc objects.

on Solaris (SPARC and x86), compilation failed like this:

/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:270:764: error: 'trunc'
conflicts with a previous declaration
  270 | typedef enum {explist, funccall, exit_, return_, stmtseq, comment,
halt, new_, dispose, inc, dec, incl, excl, length, nil, true_, false_, address,
loc, byte, word, csizet, cssizet, char_, cardinal, longcard, shortcard,
integer, longint, shortint, real, longreal, shortreal, bitset, boolean, proc,
ztype, rtype, complex_, longcomplex, shortcomplex, type, record, varient, var,
enumeration, subrange, array, subscript, string, const_, literal, varparam,
param, varargs, optarg_, pointer, recordfield, varientfield, enumerationfield,
set, proctype, procedure, def, imp, module, loop, while_, for_, repeat, case_,
caselabellist, caselist, range, assignment, if_, elsif, constexp, neg, cast,
val, plus, sub, div_, mod, mult, divide, in, adr, size, tsize, ord, float_,
trunc, chr, abs_, cap, high, throw_, unreachable, cmplx, re, im, min, max,
componentref, pointerref, arrayref, deref, equal, notequal, less, greater,
greequal, lessequal, lsl, lsr, lor, land, lnot, lxor, and_, or_, not_,
identlist, vardecl, setvalue} nodeT;
      |                                                                        
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                   ^~~~~
In file included from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-gcc/include-fixed/math.h:25,
                 from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/bits/std_abs.h:40,
                 from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/cstdlib:77,
                 from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/stdlib.h:36,
                 from /vol/gcc/src/hg/master/modula-2/gcc/system.h:265,
                 from
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:24:
/usr/include/iso/math_c99.h:492:15: note: previous declaration 'namespace std {
}::trunc'
  492 | extern double trunc __P((double));
      |               ^~~~~
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c: In function 'void
setUnary(decl_node, nodeT, decl_node, decl_node)':
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:7040:12: error: cannot
resolve overloaded function 'trunc' based on conversion to type 'int'
 7040 |       case trunc:
      |            ^~~~~
[...]
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c: In function
'nameKey_Name decl_getSymName(decl_node)':
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:24345:12: error: cannot
resolve overloaded function 'trunc' based on conversion to type 'int'
24345 |       case trunc:
      |            ^~~~~

I used the same approach as was already applied for several other cases in the
same file of renaming trunc to trunc_.  However, Gdecl.c is generated, but
I couldn't find where to apply this change in the actual source.

Reply via email to