New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 10 users
Status: Fixed
Owner:
Email to this user bounced
Closed: Oct 2010
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: ----
Type: Bug

Restricted
  • Only users with Commit permission may comment.



Sign in to add a comment
Compilation error: gcc 4.5 does not like "converting to non-pointer types from NULL"
Reported by spo...@gmail.com, Jul 19 2010 Back to list
Chrome Version (from the about:version page): 6.0.467.0
Is this the most recent version: Bug still present in svn trunk
OS + version: Fedora Rawhide (14)
CPU architecture (32-bit / 64-bit): x86_64

cc1plus: warnings being treated as errors
app/gfx/gl/gl_context_linux.cc: In member function ‘virtual void gfx::OSMesaViewGLContext::Destroy()’:
app/gfx/gl/gl_context_linux.cc:321:15: error: converting to non-pointer type ‘Pixmap’ from NULL
app/gfx/gl/gl_context_linux.cc: In member function ‘bool gfx::OSMesaViewGLContext::UpdateSize()’:
app/gfx/gl/gl_context_linux.cc:409:15: error: converting to non-pointer type ‘Pixmap’ from NULL
make: *** [out/Release/obj.target/app_base/app/gfx/gl/gl_context_linux.o] Error 1

cc1plus: warnings being treated as errors
webkit/glue/plugins/pepper_buffer.cc: In function ‘PP_Resource pepper::<unnamed>::Create(PP_Module, int32_t)’:
webkit/glue/plugins/pepper_buffer.cc:25:12: error: converting to non-pointer type ‘long int’ from NULL
webkit/glue/plugins/pepper_buffer.cc:29:12: error: converting to non-pointer type ‘long int’ from NULL
make: *** [out/Release/obj.target/glue/webkit/glue/plugins/pepper_buffer.o] Error 1
make: *** Waiting for unfinished jobs....
cc1plus: warnings being treated as errors
webkit/glue/plugins/pepper_font.cc: In function ‘PP_Resource pepper::<unnamed>::MatchFontWithFallback(PP_Module, const PP_FontDescription*)’:
webkit/glue/plugins/pepper_font.cc:27:12: error: converting to non-pointer type ‘long int’ from NULL
webkit/glue/plugins/pepper_font.cc:34:12: error: converting to non-pointer type ‘long int’ from NULL
make: *** [out/Release/obj.target/glue/webkit/glue/plugins/pepper_font.o] Error 1
cc1plus: warnings being treated as errors
webkit/glue/plugins/pepper_device_context_2d.cc: In function ‘PP_Resource pepper::<unnamed>::Create(PP_Module, const PP_Size*, bool)’:
webkit/glue/plugins/pepper_device_context_2d.cc:71:12: error: converting to non-pointer type ‘long int’ from NULL
webkit/glue/plugins/pepper_device_context_2d.cc:75:12: error: converting to non-pointer type ‘long int’ from NULL
make: *** [out/Release/obj.target/glue/webkit/glue/plugins/pepper_device_context_2d.o] Error 1
cc1plus: warnings being treated as errors
webkit/glue/plugins/pepper_image_data.cc: In function ‘PP_Resource pepper::<unnamed>::Create(PP_Module, PP_ImageDataFormat, const PP_Size*, bool)’:
webkit/glue/plugins/pepper_image_data.cc:34:12: error: converting to non-pointer type ‘long int’ from NULL
webkit/glue/plugins/pepper_image_data.cc:38:12: error: converting to non-pointer type ‘long int’ from NULL
make: *** [out/Release/obj.target/glue/webkit/glue/plugins/pepper_image_data.o] Error 1
cc1plus: warnings being treated as errors
webkit/glue/plugins/pepper_scrollbar.cc: In function ‘PP_Resource pepper::<unnamed>::Create(PP_Instance, bool)’:
webkit/glue/plugins/pepper_scrollbar.cc:31:12: error: converting to non-pointer type ‘long int’ from NULL
make: *** [out/Release/obj.target/glue/webkit/glue/plugins/pepper_scrollbar.o] Error 1
cc1plus: warnings being treated as errors
remoting/client/plugin/chromoting_plugin.cc: In constructor ‘remoting::ChromotingPlugin::ChromotingPlugin(PP_Instance, const PPB_Instance*)’:
remoting/client/plugin/chromoting_plugin.cc:35:45: error: converting to non-pointer type ‘long int’ from NULL
chrome/gpu/gpu_channel.cc: In member function ‘void GpuChannel::OnCreateViewCommandBuffer(gfx::NativeViewId, int32*)’:
chrome/gpu/gpu_channel.cc:140:36: error: converting to non-pointer type ‘gfx::PluginWindowHandle’ from NULL
chrome/gpu/gpu_channel.cc: In member function ‘void GpuChannel::OnCreateOffscreenCommandBuffer(int32, const gfx::Size&, uint32, int32*)’:
chrome/gpu/gpu_channel.cc:193:16: error: passing NULL to non-pointer argument 2 of ‘GpuCommandBufferStub::GpuCommandBufferStub(GpuChannel*, gfx::PluginWindowHandle, GpuCommandBufferStub*, const gfx::Size&, uint32, int32)’
make: *** [out/Release/obj.target/chrome_gpu/chrome/gpu/gpu_channel.o] Error 1

*****

Gcc is more strict in 4.5 about converting non-pointers to NULL. The attached patch resolves these issues. Patch was generated from 6.0.467.0 source, but should still be applicable to svn.
 
chromium-6.0.467.0-fix_NULL_conversion_errors.patch
6.0 KB View Download
Comment 1 by est...@chromium.org, Jul 20 2010
can you upload your patch to codereview.chromium.org
Comment 2 by cod...@gmail.com, Jul 22 2010
I'm seeing this issue on openSUSE 11.3 x86_64 with
gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]

Comment 3 by cod...@gmail.com, Jul 22 2010
Also ...
cc1plus: warnings being treated as errors
third_party/ppapi/cpp/module.cc: In constructor ‘pp::Module::Module()’:
third_party/ppapi/cpp/module.cc:314:78: error: converting to non-pointer type ‘long int’ from NULL
make: *** [out/Debug/obj.target/ppapi_cpp_objects/third_party/ppapi/cpp/module.o] Error 1

Comment 4 by cod...@gmail.com, Jul 22 2010
cc1plus: warnings being treated as errors
third_party/ppapi/cpp/resource.cc: In constructor ‘pp::Resource::Resource()’:
third_party/ppapi/cpp/resource.cc:14:41: error: converting to non-pointer type ‘long int’ from NULL
third_party/ppapi/cpp/resource.cc: In member function ‘PP_Resource pp::Resource::detach()’:
third_party/ppapi/cpp/resource.cc:39:18: error: converting to non-pointer type ‘long int’ from NULL

Status: Untriaged
I've been carrying basically the same patch in my tree for a while - sorry for not doing something about this sooner. Anyway, patch is here now:
http://codereview.chromium.org/3014034/show
and I'll try to get it sorted out (tree closed now and try bots failing mysteriously).

The fixes for codedr's issues in comment 2, 3 && 4 are not covered by this - that will need fixes in the ppapi svn repo and a DEPS roll in chromium.

GYP_DEFINES='werror=' might work until this stuff lands in the tree.

spotrh: have you signed the 'Contributor License Agreement' stuff btw.? In this instance since I had the same stuff in my tree it doesn't really matter.
 Issue 47401  has been merged into this issue.
Comment 7 by spo...@gmail.com, Jul 26 2010
Craig, I cannot sign the Contributor License Agreement, as that would involve me giving copyrighted work (where Red Hat is the copyright holder) to Google, and honestly, neither I nor Red Hat trust that such a grant would remain indefinitely Free (as in Freedom).

I was unaware that this was a requirement.
There are some details about contributing here btw. that links to the CLA:

http://dev.chromium.org/developers/contributing-code
I filed http://code.google.com/p/ppapi/issues/detail?id=1 for the ppapi svn repo stuff.
Labels: Mstone-X
Labels: -Area-Undefined Area-Internals Internals-Plugins Pepper
Thiago point out at http://code.google.com/p/ppapi/issues/detail?id=1 that ppapi bugs are actually tracked in the chromium bugtracker so I'm relabeling the bug here in the hopes of attracting the attention of someone with commit access in the ppapi repo to fix comment #3 and #4 here as per the patch in the ppapi link.

PS. There are some other NULL versus 0 issues that have crept into the code lately ... I'll cook up a patch for those.
I had to patch it on version 6.0.472.56. Are there been any changes since the last comment ? 
ftharsln: no changes, sorry :( My dev box is sick so I can't patch or test anything until I get that fixed (hard drive dying slowly ... should get a replacement next week).

I'll also ping some ppapi people for the fixes in that repo if they are still needed.

(there's a strong possibility that it will break again soon after being fixed since there aren't any bots running gcc 4.5)
Status: Started
Brett: could you land the patch referred to in comment #12 in the ppapi repo please or suggest someone that can? I'd be happy to roll DEPS if you want. Thank you.
Comment 17 by f...@sofaraway.org, Oct 16 2010
fyi, Ubuntu Natty also comes with gcc 4.5 and a few linker behavior changes:
https://lists.ubuntu.com/archives/ubuntu-devel-announce/2010-October/000772.html

just started to build chromium for Natty:

http://launchpadlibrarian.net/57706067/buildlog_ubuntu-natty-amd64.chromium-browser_8.0.556.0~svn20101016r62835-0ubuntu1~ucd1_FAILEDTOBUILD.txt.gz

cc1plus: warnings being treated as errors
third_party/ppapi/cpp/module.cc: In constructor 'pp::Module::Module()':
third_party/ppapi/cpp/module.cc:194:78: error: converting to non-pointer type 'long int' from NULL
make[1]: *** [out/Release/obj.target/ppapi_cpp_objects/third_party/ppapi/cpp/module.o] Error 1

Committed as r307
Status: Fixed
Comment 20 by theo...@gmail.com, Nov 18 2010
Hello all,

Is there a similar patch available for V8? I a trying to build V8 and am getting similar (converting to NULL) errors on a x64 machine. Any ideas?
theohar, can you file a bug in code.google.com/p/v8?
Project Member Comment 22 by bugdroid1@chromium.org, May 11 2011
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=85018

------------------------------------------------------------------------
r85018 | bungeman@gmail.com | Wed May 11 12:50:04 PDT 2011

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/pyautolib/pyauto.py?r1=85018&r2=85017&pathrev=85018
 M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/pyautolib/pyautolib.cc?r1=85018&r2=85017&pathrev=85018

Fix build break in pyautolib with gcc >= 4.5.
BUG= 79710 

See related issue http://code.google.com/p/chromium/issues/detail?id=49533 .

Review URL: http://codereview.chromium.org/6877001
------------------------------------------------------------------------
Labels: Feature-Plugins-Pepper
Project Member Comment 24 by bugdroid1@chromium.org, Oct 13 2012
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member Comment 25 by bugdroid1@chromium.org, Mar 10 2013
Labels: -Area-Internals -Feature-Plugins-Pepper Cr-Content-Plugins-Pepper Cr-Internals
Project Member Comment 26 by bugdroid1@chromium.org, Apr 6 2013
Labels: Cr-Blink
Project Member Comment 27 by bugdroid1@chromium.org, Apr 6 2013
Labels: Cr-Internals-Plugins
Project Member Comment 28 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content-Plugins-Pepper Cr-Internals-Plugins-Pepper
Sign in to add a comment