> So either the evaluation order of the arguments in C is undefined (gcc
> gives no warning for that code) and that the 3rd arg is computed before
Yes, argument evaluation order in C is undefined. :(
--=20
ttfn,
clark
cl...@cs...
On Sat, 6 Mar 2004, David B=E9langer wrote:
>=20
> Hi,
>=20
> I have this code structure in sablevm.c and it was seg faulting
> on OS X/ppc and I noticed recently that it segfaults also on
> Linux/x86 but not Linux/ppc. This occurs when SableVM is not
> compiled with debugging code.
>=20
> case ARG_JIT_OPTION:
> {
> const char *str =3D NULL;
> int len;
>=20
> if (...) {
>=20
> ...
>=20
> } else if (strncmp
> (argument, str =3D "intr-count=3D", len =3D strlen (str)) =3D=3D 0=
) {
>=20
> ...
>=20
> } else {
> ...
> }
>=20
> It segfaults in strlen. The reg containing str on x86 was containing N=
ULL.
>=20
> the 2nd arg or there is a bug in gcc such that gcc cannot compute the
> dependency and reverse them.
>=20
> This occurs only in non-debugging mode.
>=20
> Any suggestion/comments from C and gcc experts?
>=20
> I wi
|