Bug 990

Summary: gluegen emits code for JOCL that causes compiler warnings
Product: [JogAmp] Gluegen Reporter: Wade Walker <wwalker3>
Component: coreAssignee: Wade Walker <wwalker3>
Status: RESOLVED FIXED    
Severity: minor CC: sgothel
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
86c868fcb78b53f02ad2bae1770e4db61b892678 0b2b05c25b5072ccbce0f92e66f29b45bde762cd
Workaround: ---

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 **".