[s1mp3-dev] C compiler was Re: Linux patch to s1mp3

Bluechip csbluechip at gmail.com
Tue Jun 20 02:28:26 CDT 2006


>Theory debates are always interesting, I infiltrate the discussion to ask:
>What Z80 C compiler are we going to use?
>This will help defining our C syntax choices.

How does that work?
No z80 C compiler will know about our hardware.

>My idea would be to take the best open source compiler and to fork it
>for our needs, but only if needed and without wasting too much time.

I'd be interested to know how gcc gets on with z80.

BC


>--
>   Legolas
>
>M. Warner Losh ha scritto:
>
> >In message: <7.0.1.0.2.20060619233014.03b63408 at gmail.com>
> >            Bluechip <csbluechip at gmail.com> writes:
> >: >Actually, NULL should be defined as a plain '0'.  Comparison of
> >: >pointers against 0 is a special case in 'C' as is casting 0 to a
> >: >pointer.  Both should be the same.  In this context, the definition of
> >: >NULL doesn't matter.  It only matters when calling functions
> >: >w/old-school K&R prototypes or through "...".
> >: >
> >: >I agree we should compare against NULL if the functionr returns a
> >: >pointer.
> >:
> >: I disagree.  I personally never use NULL because
> >: every damn system defines it differently and
> >: compilers belch all over the shop.  This is an
> >: except from one of my standard include files:
> >:
> >: #define cpNULL    ((char*)0)
> >: #define vpNULL    ((void*)0)
> >: #define bpNULL    ((UI8 *)0)
> >: #define wpNULL    ((UI16*)0)
> >: #define dpNULL    ((UI32*)0)
> >: #define sNULL     ((char)0)
> >
> >That's ugly beyond belief.  Why use a non-standard thing when a
> >standard one will do?  You need a special #define for each type, which
> >is an insane explosion of defines, all of which are non-standard.
> >
> >: // The empty string: 'empty'
> >: // (Didn't really seem worthy of a global definition)
> >: static const char scach1_NULL[1] = {'\0'};
> >: #define empty ((char*)scach1_NULL)
> >
> >Ugg.  That's even worse.
> >
> >const char *empty="";
> >
> >is a lot clearer, and you'll wind up with only one copy of the empty
> >string rather than one per file.
> >
> >: You can also choose whether to debate #define
> >: over typedef ...which will ALSO cause compilers to behave differently.
> >
> >Please, no #defined types.  They are always wrong.  They haven't been
> >right since typedef was introduced into the language around v7.
> >
> >Warner
> >
> >_______________________________________________
> >s1mp3-dev mailing list
> >s1mp3-dev at s1mp3.org
> >http://s1mp3.org/mailman/listinfo/s1mp3-dev_s1mp3.org
> >
> >
> >
>
>
>_______________________________________________
>s1mp3-dev mailing list
>s1mp3-dev at s1mp3.org
>http://s1mp3.org/mailman/listinfo/s1mp3-dev_s1mp3.org




More information about the s1mp3-dev mailing list