help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flex 2.5.23 beta and C++


From: Hans Aberg
Subject: Re: Flex 2.5.23 beta and C++
Date: Tue, 22 Oct 2002 15:35:44 +0200

At 09:29 -0400 2002/10/22, W. L. Estes wrote:
>Um, I thought that functions like exit() and such worked under c++?

No, they do not exist! -- Those that exist are called std::exit, etc.

Probably implemented on all C++ compilers by now.

>> The latter is not so difficult if one adds a macro:
>> #ifdef __cplusplus
>> # define YY_STD(x)  std::x
>> #else
>> # define YY_STD(x)
>> #endif
>>
>> Then write out:
>>     YY_STD(size_t)
>>     YY_STD(exit)
>>     YY_STD(malloc)
>>     YY_STD(realloc)
>>     YY_STD(free)
>
>This is going to make flex code look ugly. As such, I'm against it. If
>c++ is really that broken, then I'm very un-interested in supporting
>it. simple calls to exit, and types such as size_t have worked in c++
>for years, afaik. Why should it suddenly break?

It was only those, size_t in four or five places, and the others only once.

For now, I would flip them in, later perhaps making separate C/C++ skelton
files, like in Bison. -- You have some provisions for writing different
code for C/C++, you could use that as well or instead, writing out
std::exit etc. explicitly.


  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]