This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g++ on solaris


On Thu, Feb 15, 2001 at 01:20:19AM -0200, Alexandre Oliva wrote:
> > 1. it couldn't compile something mmap-related with g++ which worked with gcc
> > the following applet (which flawlessly compiles on linux with gcc and g++)
> > demonstrates it:
> Why couldn't it?  Maybe just because a declaration of mmap is missing?
> In this case, -fpermissive would help.  It's the OS headers that fail
> to declare the function unless the appropriate #define is given.  It
> works in C89, but declarations are required in C99 and C++.
mman.h provides several definitions of mmap - without -D_XPG4_2 it chooses
the wrong definition:
cname_t* mmap( cname_t, int, int, int, int, size_t)
instead of
void* mmap( cname_t, int, int, int, int, size_t)
which is macro-guarded by "#if (_POSIX_C_SOURCE > 2) || defined (_XPG4_2)"
gcc fulfills that, it seems like g++ does not

> Also note that x86 and sparc are machine architectures.  There are
> several operating systems that run on some variants of these
> architectures.  You didn't tell us which operating system you're
> talkign about.  Some of these operating systems may happen to support
oh sorry - I run x86/linux and sparc/solaris
(just tested on sparc/linux, it worked perfectly)
-- 
,------------------------------------------------------------------------.
>            Fighting for peace is like fucking for virginity            <
|------------------------------------------------------------------------|
>      Patrick Mauritz       |          The Forthcoming OpenBIOS         <
>      oxygene@gmx.net       |       www.freiburg.linux.de/openbios      <
I------------------------------------------------------------------------I
{             Windows is the question and the answer is NO!              }
`------------------------------------------------------------------------'
                       I'd rather be dead than cool


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]