[Vm-dev] B3DAccelerator on 64bits

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 12 06:58:36 UTC 2018


Hi Nicolas,

On Tue, Dec 11, 2018 at 1:38 AM Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

>
> Hi,
> Compiler warnings on 64bits for B3DAccelerator Plugin makes me think it
> can't work:
>
> clang-5.0: warning: argument unused during compilation: '-mdll'
> [-Wunused-command-line-argument]
> ../../platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c:103:19:
> warning: implicit declaration of function 'getImageName' is invalid in C99
> [-Wimplicit-function-declaration]
>                 strcpy(fileName,getImageName());
>                                 ^
> ../../platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c:103:19:
> warning: incompatible integer to pointer conversion passing 'int' to
> parameter of type 'const char *' [-Wint-conversion]
>                 strcpy(fileName,getImageName());
>                                 ^~~~~~~~~~~~~~
> /usr/x86_64-w64-mingw32/sys-root/mingw/include/string.h:61:77: note:
> passing argument to parameter '_Source' here
>   char * __cdecl strcpy(char * __restrict__ _Dest,const char *
> __restrict__ _Source);
>
> We are going to pass an address on 32bits because getImageName() has not
> been declared and will be considered as returning an int...
> If the address were on low end of address space it could eventually work,
> but we can't depend on such property.
>

Agreed.  Ugh; this is ugly code (and if I'm responsible I apologize).  What
it's trying to do is find the image file's directory and write the
Squeak3D.log file there-in.  I think there are a few other places that do
this.  So instead of replicating this ugly code (that won't work on
Windows) we should be using e.g. something called getImageFileDirectory,
which may have to be written.  I'll try and look at this soon.  Maybe raise
an issue on open smalltalk-vm?


> It's vital that we properly declare function prototypes (preferably by
> using ad hoc header) and all  [-Wimplicit-function-declaration] reports
> deserve greater attention.
>


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181211/e03023b4/attachment.html>


More information about the Vm-dev mailing list