Oz and Mozart Users Mailing List

Re: gcc 3.3.1 naughtiness


From: Christian Schulte (schulte@imit.kth.se)
Date: Thu Nov 20 2003 - 17:14:50 CET


This was meant to be on hackers right?

As I did this stuff, I have to admit that I can't quite remember. From my
current understanding of C++ the curly braces make no sense (as I am not
passing an argument to a constructor).

Hmmm
Christian

"Kevin Glynn" <glynn@info.ucl.ac.be> wrote in message
news:16315.34673.911965.725458@s-ensor.info.ucl.ac.be...
>
>
> Dear Hackers,
>
> gcc 3.3.1 seems to have changed its behaviour, revealing broken code
> in the contrib directories:
>
> /bin/sh /home/keving/MOZART/scratch/build/platform/emulator/oztool.sh
c++ -O3 -I/home/keving/MOZART/scratch/mozart/platform/emulator -I/home/kev
ing/MOZART/scratch/mozart/contrib/ri -I/home/keving/MOZART/scratch/build/pla
tform/emulator -I/home/keving/MOZART/scratch/install//include -I/home/keving
/sw/lp_solve_2.3_mozart -I/usr/local/oz/include -I/home/keving/MOZART/scrat
ch/mozart/contrib/lp/../ri -Wall -Wno-unused -Wno-reorder -Wno-uninitialized
 -c /home/keving/MOZART/scratch/mozart/contrib/lp/builtins.cc -o builtins.o
> /home/keving/MOZART/scratch/mozart/contrib/lp/builtins.cc: In function
`OZ_Return ri_lpsolve_conf(OZ_Term**)':
> /home/keving/MOZART/scratch/mozart/contrib/lp/builtins.cc:93: error:
brace-enclosed initializer used to initialize `OZ_Term'
> /home/keving/MOZART/scratch/mozart/contrib/lp/builtins.cc:93: error:
brace-enclosed initializer used to initialize `OZ_Term'
> /home/keving/MOZART/scratch/mozart/contrib/lp/builtins.cc:93: error:
brace-enclosed initializer used to initialize `OZ_Term'
> /home/keving/MOZART/scratch/mozart/contrib/lp/builtins.cc:93: error:
brace-enclosed initializer used to initialize `OZ_Term'
>
> The offending code is:
>
> OZ_Term arity_def[] = {
> {OZ_pair2(atom_solver, RILPSolve::getSolverAtom())},
> {OZ_pair2(atom_mode, RILPSolve::getModeAtom())},
> {OZ_pair2(atom_avail, solver_list)},
> {(OZ_Term) 0}
> };
>
> And all is well (well, it compiles!) if I reqrite this as
>
> OZ_Term arity_def[] = {
> OZ_pair2(atom_solver, RILPSolve::getSolverAtom()),
> OZ_pair2(atom_mode, RILPSolve::getModeAtom()),
> OZ_pair2(atom_avail, solver_list),
> (OZ_Term) 0
> };
>
> (i.e., remove the braces that re enclosing the initializer). This is
> accepted by gcc 2.95.4 and gcc 3.3.1, but I don't understand the
> significance, and I haven't tested the result (affects code in lp and
> reflect).
>
> Does anyone know if this change is harmless/harmful? And why it has
> started to fail?
>
> thanks
> k
>
> PS.
>
> My gcc version
>
> [keving@quaver build]$ gcc --version
> gcc (GCC) 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
> -
> Please send submissions to hackers@mozart-oz.org
> and administriva mail to hackers-request@mozart-oz.org.
> The Mozart Oz web site is at http://www.mozart-oz.org/.

-
Please send submissions to hackers@mozart-oz.org
and administriva mail to hackers-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.