English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 16 March 2017, 06:10   #1
mbergmann-sh
 
Posts: n/a
VBCC: complain about static int (*calltrap)(...) = (int (*)(...))0xF0FF60;

HELP appreciated! What's wrong with this declaration:

Code:
static int (*calltrap)(...) = (int (*)(...))0xF0FF60;
vbcc moans it as "error 0 - declaration expected", while SAS/C, StormC v3 eat it as beeing OK.

How do I have to rewrite this statement in order to get vbcc to come clear with it?

Thanks in advance,

Michael
 
Old 16 March 2017, 07:36   #2
alpine9000
Registered User
 
Join Date: Mar 2016
Location: Australia
Posts: 881
Quote:
Originally Posted by mbergmann-sh View Post
HELP appreciated! What's wrong with this declaration:

Code:
static int (*calltrap)(...) = (int (*)(...))0xF0FF60;
vbcc moans it as "error 0 - declaration expected", while SAS/C, StormC v3 eat it as beeing OK.

How do I have to rewrite this statement in order to get vbcc to come clear with it?

Thanks in advance,

Michael
GCC gives us a more descriptive error:

Code:
error: ISO C requires a named argument before ‘...’
So for me the following compiles in gcc:

Code:
static int (*calltrap)(int, ...) = (int (*)(int, ...))0xF0FF60;
Sorry I can't test with vbcc, my install is borked at the moment.
alpine9000 is offline  
Old 16 March 2017, 08:41   #3
mbergmann-sh
 
Posts: n/a
Quote:
Originally Posted by alpine9000 View Post
GCC gives us a more descriptive error:

Code:
error: ISO C requires a named argument before ‘...’
So for me the following compiles in gcc:

Code:
static int (*calltrap)(int, ...) = (int (*)(int, ...))0xF0FF60;
Sorry I can't test with vbcc, my install is borked at the moment.
Well big thanks! Since this is part of uae_pragmas.h from e-uae src, I guess I'll have to rewrite that module in order to compile. Should be the samm with vbcc...
 
Old 17 March 2017, 01:19   #4
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
A function with just one varargs argument makes not much sense in ANSI/ISO-C. The va_arg() macro requires the name of the last argument before the '...' to work.
phx is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Rare] Amiga User Int. adfs found! RoboCop AMR contributions 13 27 May 2016 01:08
asm game - how implement exit to OS via PORTS int Asman Coders. General 4 28 June 2011 11:07
ASM: false int vector ($60) Asman Coders. General 2 13 September 2010 09:22
ASM: VERTB int and 16 colored sprites. Asman Coders. Tutorials 5 28 April 2010 14:18
INT-2 modification on Cyberstorm boards? astuermer support.Hardware 2 06 October 2005 15:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:52.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09294 seconds with 13 queries