Bug 990 - gluegen emits code for JOCL that causes compiler warnings
Summary: gluegen emits code for JOCL that causes compiler warnings
Status: RESOLVED FIXED
Alias: None
Product: Gluegen
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: All all
: --- minor
Assignee: Wade Walker
URL:
Depends on:
Blocks:
 
Reported: 2014-03-02 21:52 CET by Wade Walker
Modified: 2014-03-10 21:21 CET (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
86c868fcb78b53f02ad2bae1770e4db61b892678 0b2b05c25b5072ccbce0f92e66f29b45bde762cd
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wade Walker 2014-03-02 21:52:14 CET
Gluegen's native binding code causes two kinds of compiler warning for JOCL.

Type 1: The line

int * _offsetHandle = NULL;

gives an "unused variable" warning for _offsetHandle if the argument type isn't an NIO buffer array. This can probably be fixed by putting 

if(type.isNIOBufferArray())

in CMethodBindingEmitter.emitBodyVariableDeclarations().

Type 2: The clCreateProgramWithBinary() function in cl.h has an argument of type "const unsigned char **". Gluegen generates code that declares the body variable as "char * *" and casts it to "const char * *", which gives an incompatible pointer type warning. This looks like it requires a fix in CMethodBindingEmitter as well, but the fix may be more involved since the code currently seems unaware of "unsigned".
Comment 1 Wade Walker 2014-03-04 22:58:27 CET
A fix for both of these is in https://github.com/sgothel/gluegen/pull/19. It includes a new unit test for C functions with a parameter of type "unsigned char **".