<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>990</bug_id>
          
          <creation_ts>2014-03-02 21:52:14 +0100</creation_ts>
          <short_desc>gluegen emits code for JOCL that causes compiler warnings</short_desc>
          <delta_ts>2014-03-10 21:21:39 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Gluegen</product>
          <component>core</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wade Walker">wwalker3</reporter>
          <assigned_to name="Wade Walker">wwalker3</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>86c868fcb78b53f02ad2bae1770e4db61b892678
0b2b05c25b5072ccbce0f92e66f29b45bde762cd</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3819</commentid>
    <comment_count>0</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2014-03-02 21:52:14 +0100</bug_when>
    <thetext>Gluegen&apos;s native binding code causes two kinds of compiler warning for JOCL.

Type 1: The line

int * _offsetHandle = NULL;

gives an &quot;unused variable&quot; warning for _offsetHandle if the argument type isn&apos;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 &quot;const unsigned char **&quot;. Gluegen generates code that declares the body variable as &quot;char * *&quot; and casts it to &quot;const char * *&quot;, 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 &quot;unsigned&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3824</commentid>
    <comment_count>1</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2014-03-04 22:58:27 +0100</bug_when>
    <thetext>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 &quot;unsigned char **&quot;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>