26 May 2014, 12:24 | #1 |
Registered User
Join Date: Apr 2013
Location: Mallorca
Posts: 772
|
From gcc to vbcc.
Working on some big/old classic source code:
To the fellow coders: What are the key factors or things to look after to arrange gcc source to be compatible enough to work with vbcc? (I'm using posix lib from vbcc by the way) |
26 May 2014, 12:44 | #2 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,569
|
If you work with gcc and want to keep it compatible with other compilers (like vbcc), use at least -std=c99, -ansi and -pedantic options to avoid gcc-specific extensions and keep the code clean.
If you work with vbcc and try to port a gcc source you will likely see the problems very soon. If you have the time, try to remove all Posix stuff which has to be emulated. The gcc-version should compile with -noixemul and the vbcc-version shouldn't require PosixLib. A real Amiga program is always cleaner. |
26 May 2014, 13:12 | #3 |
Registered User
Join Date: Apr 2013
Location: Mallorca
Posts: 772
|
First is the makefile nightmare
I don't have nowadays any complete gcc stuff vbcc to me "is" the way to go. Problems in the code are related to some calls to things like bzero, or fopen ,etc. So posix helps: No idea of how to implement all that (now). Some of the object files need to be compiled with amitcp includes as something doesn't work with posix includes all the way to the different binaries (dlls) I hacked my way to produce a binary: Of course it doesn't work but at least I does some output. Complicated stuff |
26 May 2014, 13:25 | #4 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,888
|
@PHX
a bit off topic but is VBCC better performance wise than GCC? Any comparison with newer version of GCC? http://sun.hasenbraten.de/vbcc/index...iew=benchmarks Kamelito |
26 May 2014, 14:21 | #5 | |||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,569
|
Quote:
Quote:
Code:
#define bzero(p,l) memset(p,0,l) Quote:
|
|||
26 May 2014, 14:27 | #6 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,569
|
Maybe still in some cases. Also depends on the CPU backend used.
Quote:
|
|
26 May 2014, 16:45 | #7 |
Registered User
Join Date: Apr 2013
Location: Mallorca
Posts: 772
|
@phx
Located bzero Thanks! Maybe also "strdup" can be defined easily. But others like stat, putenv, isort, mkdir .... maybe I will have to do an special "posix.o" with all in it. |
06 June 2014, 13:59 | #8 |
Registered User
Join Date: Apr 2013
Location: Mallorca
Posts: 772
|
Can't figure out this:
Code:
#define CRAP(x) (int)&(((something_t *)0)->x) field_t fields[] = { {"whatever", CRAP(whatever),MORE}, }; |
06 June 2014, 14:11 | #9 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,041
|
Code:
#include <stddef.h> #define CRAP(x) (int)offsetof(something_t,x) |
06 June 2014, 14:45 | #10 | |
Registered User
Join Date: Apr 2013
Location: Mallorca
Posts: 772
|
Quote:
But now I have to figure out something like (anotherthing.other, x) ....seems like I need a ")" and a "}" expected. Just tried fast your recipe EDIT: Sorry for (whatever.whatever) Last edited by Cowcat; 06 June 2014 at 15:43. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vbcc: no startup | aragon | Coders. C/C++ | 2 | 16 February 2014 14:52 |
(Useless benchmark) Dhrystone on Sas C/Gcc/Vbcc | alkis | Coders. System | 3 | 16 October 2013 13:03 |
Compiling CLib37 with VBCC 0.9 | tnt23 | Coders. General | 2 | 29 July 2013 10:28 |
VBCC 0.8j for Windows | hitchhikr | Coders. General | 11 | 09 October 2008 00:58 |
Kickstart 1.3 and GCC or VBCC? | cdoty | Coders. General | 1 | 23 April 2005 06:10 |
|
|