use of cast expressions as lvalues
Hello Speaking of compiler warnings: I'm sometimes getting: foo.c:7033: Warnung: use of cast expressions as lvalues is deprecated in cases like: (c-declare "....... struct sigqueue * global_queue;") .... (define global-queue (c-lambda () sigqueue "___result= global_queue;")) Is there a more correct way to assign something to the result? Thanks Christian.
Afficher les réponses par date
On 29-Jan-06, at 9:56 AM, Christian wrote:
Hello
Speaking of compiler warnings: I'm sometimes getting:
foo.c:7033: Warnung: use of cast expressions as lvalues is deprecated
in cases like:
(c-declare "....... struct sigqueue * global_queue;") .... (define global-queue (c-lambda () sigqueue "___result= global_queue;"))
Is there a more correct way to assign something to the result?
Yes. Whenever you are returning a pointer, you have to assign it to ___result_voidstar (which is a variable of type void*). So your code should read: (define global-queue (c-lambda () sigqueue "___result_voidstar = global_queue;")) Gambit uses this approach to avoid some problems with C++ handling of pointers. Marc
participants (2)
-
Christian -
Marc Feeley