Re: [ecasound] ecawave compilation error with gcc-3.2

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] ecawave compilation error with gcc-3.2
From: Kai Vehmanen (k_AT_eca.cx)
Date: Thu May 29 2003 - 16:55:08 EEST


On Thu, 29 May 2003, Kai Vehmanen wrote:

> Yup, <cassert> is the official C++ way to import assert headers.
> One catch is that all C++ symbols are in the std namespace, so you need to
> access them using std:: prefix (like std::prefix). To add to the
> confusion, if you import using C headers (like assert.h) the symbols are
> in global space and you not need the std:: prefix. On the other hand older
> gcc versions accepted uses like assert without the std:: prefix even if
> imported with <cassert>. So quite a mess.

Correcting myself a bit... the above is somewhat misleading as 'assert'
is still a macro in C++, so it's global in any case (thus no std:: prefix
is needed).

Maybe something like stdlib.h and the function abs() is a better example.
While <stdlib.h> is the standard C header, C++ has <cstdlib>. With the
recent versions of gcc/c++, the two headers no longer behave identically.
Now you explicitly have to use std::abs() is using <cstdlib>. In other
words gcc has become more strict about what is valid C++ code.

With gcc-3.3, the errors seem to mostly come from implicit uses of
functions and macros. For instance in ecawave and ecamegapedal I've used
assert in a few places without including neither assert.h or
cassert.

-- 
 http://www.eca.cx
 Audio software for Linux!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu May 29 2003 - 16:56:03 EEST