Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on May 05, 2005, 04:15:36 pm

Title: warning: inline function ... declared as dllimport
Post by: tiwag on May 05, 2005, 04:15:36 pm
Whenever I compile C::B application using the default Project configuration file "CodeBlocks-wx2.6.0.cbp" from cvs ,
which sets compiler option -Wall,
I get thousands of warnings that look something like this:

Quote
..wx260/include/wx/buffer.h:96: warning: inline function 'wxCharBuffer::wxCharBuffer(const char*)' is declared as dllimport: attribute ignored.


You can't have it both dllimport and inline.

This is fine, but I don't want this warning. I want the inlined version.

Is there a way to disable this warning? I didn't see anything that looked
useful in the GCC manual.

using
MinGW gcc 3.4.2, wxMSW 2.6.2, WinXP


[edit]
@all,
additionally i would like to know, if others get the same tons of warnings.
is this normal behaviour ?
otherwise i have to look if something is wrongly set up in my wxwidgets configuration.

thanks, tiwag
Title: warning: inline function ... declared as dllimport
Post by: mandrav on May 05, 2005, 10:31:29 pm
wxWidgets-2.6.0 generate a gazillion of warnings for me too...
I know I 'm not of much help, but I just thought I 'd share  :roll:

Yiannis.
Title: warnings using GCC and wx_dll
Post by: tiwag on May 22, 2005, 07:33:43 pm
i found a way to avoid the

Code::Blocks compiler settings:
check the following warnings
------------------------------------------------------------------------------
* Enable all compiler warnings (overrride every other setting)  ..... results to (-Wall)
* Enable warnings demanded by strict ISO C ans ISO C++  ..... results to (-pedantic)

use the following under
more options:
------------------------------------------------------------------------------
-Wno-long-long
-Wcast-align
-Wconversion
-Wdeprecated
-Wimport
-Wnon-template-friend
-Wpmf-conversions
-Wpointer-arith
-Wsign-compare
-Wsynth
-Wwrite-strings[/list:u]

THis allows to compile standard wxWidgets samples like
minimal, console, listbox and widgets
( at least they i've tested ) without compile warnings.


When i try to build codeblocks with this compiler settings,
i found a few warnings and also compile errors,
which are trivial to avoid following the suggested actions from the warning- or error-messages.
When i do this corrections to the CB code i'm not longer in sync with the CVS version to incorporate latest diffs easy.

therefore i would like to know, if mandrav maybe is interested in using more effective compiler warning settings, in order to avoid hundreds of these nasty dll-import warnings with the effect, that some important and useful warnings are likely to be overseen in the vast number of warnings.

As i mentioned it would need some corrections to the code base,
things like
Code

/* wxminimal.cpp */

#include "wx/wx.h"

class HelloWorldApp : public wxApp
{
public:
    virtual bool OnInit();
};

IMPLEMENT_APP(HelloWorldApp)

bool HelloWorldApp::OnInit()
{
    wxFrame * frame = new wxFrame((wxFrame *) NULL, -1,
                                  _T("Hello ")
                                  _T(wxVERSION_STRING),
                                  wxPoint(60,70),
                                  wxSize(300,160));

    frame->Show(TRUE);

    SetTopWindow(frame);

    return true;
}


regards,
tiwag
Title: warning: inline function ... declared as dllimport
Post by: mandrav on May 22, 2005, 08:54:00 pm
Quote
which i can do, if mandrav is interested in.

Sure, just submit a patch :)

Yiannis.
Title: warning: inline function ... declared as dllimport
Post by: heromyth on July 01, 2005, 04:45:11 am
Yeah, I have found that it won't produce the warning without the GCC compiler option '-W'. I have replace all '-W' in wxWidgets' makefile with none.