Re: static const int optimization fails in conditional expressions

2001-12-11 Thread James E Jurach Jr.
> Compilers are allowed to optimize static const integral members, in the > sense that their values may be used directly. Right. I'm reporting that 1) gcc's behavior changed in this regard in 2.96 and 3.00 from 2.95 and previous, and 2) gcc sometimes uses these values directly without defini

Re: static const int optimization fails in conditional expressions

2001-12-11 Thread Phil Edwards
On Tue, Dec 11, 2001 at 08:45:40PM -0600, James E Jurach Jr. wrote: > I understood from nm(1) output that, at least in the past, g++ did not > create a symbol for these int's, but rather performed some kind of inline > optimization. Compilers are allowed to optimize static const integral members,

Re: static const int optimization fails in conditional expressions

2001-12-11 Thread James E Jurach Jr.
> On Tue, Dec 11, 2001 at 05:06:31PM -0600, James Jurach wrote: > > When class members declared as static const int appear in conditional > > expressions, they are not properly optimized out. The compiler treats them > > as undefined variables, rather than integer literals. > > That's because they

Re: static const int optimization fails in conditional expressions

2001-12-11 Thread Phil Edwards
On Tue, Dec 11, 2001 at 05:06:31PM -0600, James Jurach wrote: > When class members declared as static const int appear in conditional > expressions, they are not properly optimized out. The compiler treats them > as undefined variables, rather than integer literals. That's because they /are/ unde

static const int optimization fails in conditional expressions

2001-12-11 Thread James Jurach
>Submitter-Id: net >Originator:James Jurach >Organization: FundsXpress >Confidential: no >Synopsis: static const int optimization fails in conditional expressions >Severity: serious >Priority: medium >Category: c++ >Class: sw-bug >Release: 3.0.3 20011209 (D

Bug#123468: gcc: asserts with side effects

2001-12-11 Thread Anthony DeRobertis
Package: gcc Version: 2:2.95.4-8 Severity: wishlist -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I realize this is probably implemented easily, but a warning about asserts with obvious side effects would be nice. For example: assert(ptr = malloc(...)) /* programmer didn't understa

Re: possibly a bug in g++

2001-12-11 Thread Martin v. Loewis
> In my opinion, tfunc_t is a pointer to function, not reference. This > is because the function name (without a context) is a pointer to > that function, not a reference. If I am wrong, please, let me know. You are wrong. tfunc_t is neither of type "pointer to function" nor of type "reference to

Re: possibly a bug in g++

2001-12-11 Thread Alexei Khlebnikov
Ugh, sorry for late answer. I was ill and thinked about this subject. "Martin v. Loewis" wrote: > > Please answer somebody wether it is a bug and wether I should submit it to > > GNATS. > > I believe this is not a bug, because there are no const-qualified > function types in C++. > > If you don'