Re: Help with strict-aliasing warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Orion Poplawski wrote:
> I'm getting:
> 
> /builddir/build/BUILD/gdl-0.9.8/src/basic_pro_jmg.cpp: In function 'void
> lib::linkimage(EnvT*)':
> /builddir/build/BUILD/gdl-0.9.8/src/basic_pro_jmg.cpp:159:36: warning:
> dereferencing type-punned pointer will break strict-aliasing rules
> [-Wstrict-aliasing]
>         (BaseGDL* &) dynFun[count_fun] =
>                      ~~~~~~~~~~~~~~~~^
>                    (BaseGDL*) dlsym(module[count], entryName.c_str());
> 
> 
> dynFun is defined as:
> 
>    BaseGDL*(*dynFun[MAXNDLL/2])( EnvT* e);
> 
> This is all beyond me.  Missing the function pointer argument
> specification?

Try:

dynFun[count_fun] =
  (BaseGDL*(*)(EnvT*)) dlsym(module[count], entryName.c_str());

        Kevin Kofler
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux