Euphoria Ticket #879: Allows one to define C routines that take more than 9 arguments.

The run-time system won't allow your code to call a C function/procedure with more than 9 arguments, but the front end should detect the situation when your application defines such a C routine.

Currently, the program crashes at run-time if it actually attempts to call a C routine with 10 or more arguments, but it would be better if this was caught during front-end parsing instead because that way the coder will get to see the source code line number during testing. The current message might not be seen during testing and only reported by your irate customer instead.

The code here will run unless you actually call 'DC'.


include std/dll.e 
constant lib = open_dll("dllname") 
constant DC = define_c_func( lib, "somename", {C_INT, C_INT, C_INT, C_INT, C_INT,  
                                               C_INT, C_INT, C_INT, C_INT, C_INT}, 
                                      C_INT) 

Details

Type: Bug Report Severity: Minor Category: Front End
Assigned To: unknown Status: Invalid Reported Release: 4.0
Fixed in SVN #: View VCS: none Milestone: 4.1.0

1. Comment by DerekParnell Jul 11, 2013

I withdraw this ticket. I misunderstood the C calling subsystem. I can see now it can cater for any number of arguments, and its only callback routines that are restricted to nine arguments.

2. Comment by mattlewis Jul 11, 2013

The unlimited number of arguments is really only for x86, where we use inlined ASM to push arguments. Other architectures use different calling conventions, and there we support up to 15 arguments.

Search



Quick Links

User menu

Not signed in.

Misc Menu