Re: gcc 3 versions won't compile hello.cpp



On Sat, 1 Apr 2006 20:00:01 UTC, Ilya Zakharevich <nospam-abuse@xxxxxxxxx> wrote:

[A complimentary Cc of this posting was sent to
Dave Parsons
<dwparsons@xxxxxxxxx>], who wrote in article <Ej0w7lFo08Zw-pn2-5icSOo6gtPCI@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
And given that nobody answered my question about existence of #pragma
to switch default cc to _System, it does not look like I may try it
soon. :-(

Where was that thread & what was the problem?

Oh, it was the glib thread. It is quite long, so let me repeat: given
hundreds (if not a thousand) libraries present for for EMX, AND the
fact that the default calling convention for

int foo(int);

changed in (most ports of) gcc3, how can one use gcc3 for non-vertical
development? (With vertical development, one just recompiles the
world for every change in environment...)

Given a pragma to (temporarily) change the default to _System, I could
at least generate wrapper headers for all the headers for existing
libraries, and use a different C_INCLUDE_PATH for gcc3, as in

gcc3/foo/foo.h:

#pragma gcc_cc(_System);
#include "../../emx/foo/foo.h"
#pragma gcc_cc();

Is there a different solution?

Ok, I've read the thread now and I am a bit confused since the
default source code, i.e. no convention modifier used, produced
by both 2.8.1 and 3.3.5 is equivalent.

using:-
gcc -c -S -O2 system.c
-----------------------
#include <os2.h>

int foo( int a, int b )
{
return( a-b );
}
-----------------------

Both use the stack right to left and both prepend an underscore.

With 3.3.5, if you use _System you do not get an underscore and
if you use _Optlink it uses registers and again no underscore.

Obviously, as Rudi pointed out, there is no difference with 2.8.1.

Which is the combination that concerns you?

There is no pragma available that I could find.

--
Cheers,
Dave

.



Relevant Pages

  • Re: reading a C++ structure from a binary file using C#
    ... because it pragma pack was used several different values would be possible. ... The int is the first field of the struct, the second is a char array which has no alignment restriction, so, whatever the packing, the length written on disk will be 74. ... Padding is included in sizeof, because sizeof is the separation between adjacent array elements which must both be properly aligned. ...
    (microsoft.public.dotnet.languages.csharp)
  • (part 1) Han from Chinas C learning program
    ... int main ... Using more than one adjacent underscore at the start of an identifier ... the only spacing that is essential is as follows: ... // stdout can be determined not to refer to an interactive ...
    (comp.lang.c)
  • Re: without loop printing 1 to n
    ... int main ... void printrange ... from any other external name in the first six characters. ... underscore after the fifth character of this function name, ...
    (comp.lang.c)
  • Re: gcc 3 versions wont compile hello.cpp
    ... changed in gcc3, how can one use gcc3 for non-vertical ... (With vertical development, one just recompiles the ... Given a pragma to change the default to _System, ... at least generate wrapper headers for all the headers for existing ...
    (comp.os.os2.programmer.tools)
  • 64 bit compiler runtime problem
    ... I am porting my 32bit windows driver to 64 bit windows driver,this driver is ... using some dynamic initializer which works good in 32 bit windows but not in ... #pragma data_seg ... int _cdecl atexit ...
    (microsoft.public.development.device.drivers)