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: Mark Weaver
Subject: RE: Flex 2.5.23 beta and C++
Date: Tue, 22 Oct 2002 15:05:34 +0100

C++ uses namespaces, and this is an inherent part of the language.  If you
want old style global function declarations, you can typically (of course
this depends on your compiler; I've not seen one for this doesn't work
however) include the old style header.  That is:

#include <cstdio>

will require a 'std::' prefix and

#include <stdio.h>

will not.  The difference is 'pure' C++ vs C compiled as C++.  Typically the
latter has functions declared with extern "C" (and it's a good bet that the
former does namespace std { using ::exit }).

Mark

> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf
> Of W. L. Estes
> Sent: 22 October 2002 14:55
> To: Hans Aberg
> Cc: Help Flex
> Subject: Re: Flex 2.5.23 beta and C++
>
>
> On Tuesday, 22 October 2002,15:35 +0200, Hans Aberg wrote:
>
> > 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.
>
> My interest in supporting c++ just dropped a lot. What idiot broke
> code that has been working for over a decade?
>
> > 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.
>
> Yes, there will be separate skeleton files--if c++ is still supported,
> that is. I've spent a lot of time trying to cope with the differences
> in various C platforms, but at least that seemed possible. If the c++
> standards people are going to act like morons, then I'm not interested
> in wasting my time with their stupidity.
>
> --Will
>
>
> _______________________________________________
> Help-flex mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-flex
>





reply via email to

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