Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: ChaosLord on December 02, 2005, 02:56:28 PM

Title: Does SASC have a secret C99 switch?
Post by: ChaosLord on December 02, 2005, 02:56:28 PM
It would be nice if I could sometimes use C99 features in SASC.  Is it possible?

For example declaring variables where they are needed, not always in the first few lines of a 'block'.
Title: Re: Does SASC have a secret C99 switch?
Post by: kas1e on December 02, 2005, 03:21:10 PM
The same question from me :) http://www.amiga.org/forums/showthread.php?t=18951

but still not have answer. I think time to read all sasc documentation :) Becouse 'static declaration' problem already f**ked up for me ..
Title: Re: Does SASC have a secret C99 switch?
Post by: SamuraiCrow on December 02, 2005, 05:20:00 PM
I think SAS was out before the C99 specification was complete.  If you want C99 try VBCC.
Title: Re: Does SASC have a secret C99 switch?
Post by: Piru on December 02, 2005, 06:06:50 PM
@ChaosLord
Quote
Does SASC have a secret C99 switch?

No.

Quote
It would be nice if I could sometimes use C99 features in SASC. Is it possible?

No.
Title: Re: Does SASC have a secret C99 switch?
Post by: ChaosLord on December 02, 2005, 06:23:34 PM
I think I found it here! Experimental C++ compiler.
It should have the feature we want.

https://www.warped.com/amiga/

But the file has been deleted!
 :bigcry:  :bigcry:  :bigcry:
Title: Re: Does SASC have a secret C99 switch?
Post by: Piru on December 02, 2005, 07:13:46 PM
@ChaosLord

That stuff has nothing to do with C99 though.

Also, the C++ stuff wasn't very complete I'm afraid.
Title: Re: Does SASC have a secret C99 switch?
Post by: ChaosLord on December 03, 2005, 12:04:05 AM
@Piru

I was under the impression that most C++ compilers, even unfinished experimental versions had many C99 features. (?)
Title: Re: Does SASC have a secret C99 switch?
Post by: kas1e on December 03, 2005, 07:25:14 AM
vbcc is good, but little slower over sasc.
btw, only one think in sasc is annoing me - declaring variables in statemn blocks. Maybe any ideas to avoid/path it/etc ? Maybe kind of macros,or somethink like ..
Title: Re: Does SASC have a secret C99 switch?
Post by: Karlos on December 03, 2005, 12:40:38 PM
VBCC is handy as a C99 compiler, although it doesn't implement everything in the C99 specification. That said, I haven't had any problems with it.
Title: Re: Does SASC have a secret C99 switch?
Post by: ChaosLord on December 03, 2005, 12:52:20 PM
Does VBCC have a good graphical debugger as SASC does?
Title: Re: Does SASC have a secret C99 switch?
Post by: Piru on December 03, 2005, 01:05:09 PM
@ChaosLord
Quote
I was under the impression that most C++ compilers, even unfinished experimental versions had many C99 features. (?)

I guess it depends on your definition of 'many'.

Regardless C++ isn't C.
Title: Re: Does SASC have a secret C99 switch?
Post by: Karlos on December 03, 2005, 03:11:06 PM
Quote

Piru wrote:

Regardless C++ isn't C.


True. If you write good clean C code, it should compile fine under C++ but there are more caveats than just the non implicit void * cast. You'd have to be unlucky to run into them, however.

For AmigaOS, the only real syntactical gotcha I ever stumbled across was the library base structure name / library base pointer name issue which was down the the deprecation of the 'struct' keyword beyond defining the structure:

struct IntuitionBase* IntuitionBase;

is fine in C, but in ANSI C++ it caused problems.

IntuitionBase* IntuitionBase;

was also a problem, I had to use

IntuitionBase* ::IntuitionBase;

:-)