[webkit-dev] Getting global object from a webkit context throws a warning

Mark Rowe mrowe at apple.com
Thu Jun 25 12:19:43 PDT 2009


On 2009-06-25, at 02:14, Sebastian Linke wrote:

> I'm currently learning how a JavaScript context is structured.  
> Therefore I just
> load a site in a WebKit session and try to access the property  
> "document.forms"
> using `JSObjectGetProperty()`: http://paste.pocoo.org/show/125018/
>
> But before I go on, I would like to know why I get this warnings:
>
> $ LANG=C gcc test.c -o test $(pkg-config --cflags --libs webkit-1.0)
> test.c: In function 'get_forms':
> test.c:23: warning: assignment makes pointer from integer without a  
> cast
> test.c:24: warning: assignment makes pointer from integer without a  
> cast
> test.c:25: warning: assignment makes pointer from integer without a  
> cast
>
> I'm using the Debian package `libwebkit-dev` to compile under Ubuntu  
> 9.04.
>
> I think there is something, that I overlook. But I don't know  
> what. :-(

By not including JavaScriptCore/JavaScript.h, the compiler is left to  
assume that the JSFoo functions that you are calling return int.  If  
you include the right headers the compiler will know the return type  
of the methods and the warnings will go away.

- Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3166 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090625/109188d5/attachment.bin>


More information about the webkit-dev mailing list