Jean-Marc Lasgouttes wrote:

> Michael> On 12 Jan 2000, Jean-Marc Lasgouttes wrote:
> >> This is normal, since I need a using std::abort(); here. However, I
> >> am surprised that this is not mentionned in your messages. Does it
> >> mean that CC 5.0 does not put _everything_ in std? I am a bit
> >> puzzled.

Hi Jean Marc and all other LyX gurus,

some more insight into the behaviour of Sun CC wanted???

Ok, you are right, it was _very_ strange that Sun CC did not complain
about the missing definition of abort (because it was not put into the
current namespace by a "using" statement). Now I can provide an
explanation for that behaviour:

1. If you use a header file such as <cstdlib> or <csignal> than all
declarations are put into the "std" namespace. So far, so good.

2. If you use an old-style header file such as <stdlib.h> or <signal.h>
all declarations are put into the "std" namespace as well. Fine:
However, a list of "using" statements is added such that you can use all
functions directly. To a certain extend this makes sense as you do not
have to change existing programs if you move to a compiler that supports
name spaces (for example: LyX!).

Once again the question raises whether this is a Sun CC specific feature
or whether this is a behaviour clearly stated in the ANSI standard. I
guess that Sun CC is right.

What does this mean for Lyx? First all, everything is fine. (Sun
expected you to write code in that manner) However, if you want to make
Lyx a modern C++ program you should change any old-fashioned include
statement into the more modern counterpart. (Do a global search and
replace, check in the code and I will try to compile it)

In the special case of "abort" both alternative include statements were
used in the same file (or more precisely in their header files' header
files). Hence, the name space problem did not occur.

Have a good night (hope you sleep tight despite the problem which is
none in principle :-)

Michael

PS: Once again, I would like to point out that csignal does not include
"kill", even though signal.h does. "kill" does not seem to be a ANSI C++
standard function.

Reply via email to