Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-11 Thread Abdelrazak Younes

Abdelrazak Younes a écrit :
Now that -Wl is passed to g++ (shouldn't it be -Wall by the way?) I have 
an awful lot of warnings. As I don't want Marchall Lastgouttes to catch 
me on that, here is my first report :-),


here my second one, we talk here about hundreds of warning per file. An 
excerpt here:


d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:262: 
warning: inline
function 'const QComboBoxPrivate* QComboBox::d_func() const' is declared 
as dllimport: att

ribute ignored.
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:279: 
warning: inline
function 'void QComboBox::addItem(const QString&, const QVariant&)' is 
declared as dllimpo

rt: attribute ignored.
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:282: 
warning: inline
function 'void QComboBox::addItem(const QIcon&, const QString&, const 
QVariant&)' is decla

red as dllimport: attribute ignored.
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:286: 
warning: inline
function 'void QComboBox::insertItem(int, const QString&, const 
QVariant&)' is declared as

 dllimport: attribute ignored.
In file included from d:/program/Qt/4.1.1//include/QtGui/qdialog.h:1,
 from d:/program/Qt/4.1.1//include/QtGui/QDialog:1,
 from ../ui/QBibtexUi.h:10,
 from ../QBibtexDialog.h:15,
 from QBibtexDialog_moc.C:10:
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/dialogs/qdialog.h:37: 
warning: inline fun
ction 'QDialogPrivate* QDialog::d_func()' is declared as dllimport: 
attribute ignored.
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/dialogs/qdialog.h:37: 
warning: inline fun
ction 'const QDialogPrivate* QDialog::d_func() const' is declared as 
dllimport: attribute

ignored.
In file included from d:/program/Qt/4.1.1//include/QtGui/qlayoutitem.h:1,
 from 
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/kernel/qlayout.h:28

,
 from d:/program/Qt/4.1.1//include/QtGui/qlayout.h:1,
 from 
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/kernel/qgridlayout.

h:27,
 from d:/program/Qt/4.1.1//include/QtGui/qgridlayout.h:1,
 from d:/program/Qt/4.1.1//include/QtGui/QGridLayout:1,
 from ../ui/QBibtexUi.h:11,
 from ../QBibtexDialog.h:15,
 from QBibtexDialog_moc.C:10:



Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-11 Thread Enrico Forestieri
On Tue, Apr 11, 2006 at 08:08:32PM +0200, Abdelrazak Younes wrote:
> Now that -Wl is passed to g++ (shouldn't it be -Wall by the way?) I have 
> an awful lot of warnings. As I don't want Marchall Lastgouttes to catch 
> me on that, here is my first report :-), Most of them are:
> 
> d:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/stl_uninitialized
> .h:82: warning: '__cur' might be used uninitialized in this function
> 
> idea?

That's -Wl,--export-all-symbols and simply passes --export-all-symbols
to the linker. It does no good and simply will increase your linking
time. I suggest that you get rid of it.

-- 
Enrico


Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-11 Thread Angus Leeming
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> here my second one, we talk here about hundreds of warning per file. An 
> excerpt here:

> d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:262: 
> warning: inline
> function 'const QComboBoxPrivate* QComboBox::d_func() const' is declared 
> as dllimport: attribute ignored.

Right. This one is a right royal pain in the arse and there's absolutely no way
to turn it off without losing other interesting warnings. Curse Qt is the best I
can suggest.

What I tend to do (or did ;-)) is pipe the compiler output to a file and then
filter out those warnings I wasn't interested in.

make 2>&1 | tee make.log
sed '/declared as dllimport/d' make.log

or even

make 2>&1 | sed '/declared as dllimport/d' | tee make.log

Angus



Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Abdelrazak Younes

Angus Leeming a écrit :

Abdelrazak Younes <[EMAIL PROTECTED]> writes:
here my second one, we talk here about hundreds of warning per file. An 
excerpt here:


d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:262: 
warning: inline
function 'const QComboBoxPrivate* QComboBox::d_func() const' is declared 
as dllimport: attribute ignored.


Right. This one is a right royal pain in the arse and there's absolutely no way
to turn it off without losing other interesting warnings. Curse Qt is the best I
can suggest.


Well, with Qt4, this happens only for "moc/*_moc.C". I had a look at 
qtglobal.h and I saw this:


#ifndef Q_DECL_IMPORT
#  ifdef Q_OS_WIN
#define Q_DECL_IMPORT __declspec(dllimport)
#  else
#define Q_DECL_IMPORT
#  endif
#endif

If I add -DQ_DECL_IMPORT all the warnings are transformed in errors:
d:/program/Qt/4.1.1//include/QtCore/../../src/corelib/tools/qbytearray.h:446: 
error: cannot convert `const QByteArray' to `const char*' for argument 
`1' to `int strcmp(const char*, const char*)'


By the way, what is the option to undefine a macro (opposite of "-D")?

Maybe we have a problem in the macro we pass to g++? Here is a typical 
compil command:


g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src -DQT_CLEAN_NAMESPACE 
-DQT_GENUINE_STR -DQT_NO_STL -DQT3_SUPPORT -DQT_NO_TRANSLATION 
-I../../../../src -I../../../../src/frontends 
-I../../../../src/frontends/controllers -I../../../../src/frontends/qt4 
-I../../../../src/frontends/qt4 -Id:/program/Qt/4.1.1//include 
-Id:/program/Qt/4.1.1//include/Qt -Id:/program/Qt/4.1.1//include/QtCore 
-Id:/program/Qt/4.1.1//include/QtGui 
-Id:/program/Qt/4.1.1//include/Qt3Support -I../../../../boost -Wextra 
-Wall -I/cygdrive/d/program/Aspell-0.60.4/include -O3 -c 
QTocDialog_moc.C -o QTocDialog_moc.o


Who decide what macro to pass? The moc or our autotools script? Maybe 
there something specific for Windows... Just thinking loud here.



What I tend to do (or did ;-)) is pipe the compiler output to a file and then
filter out those warnings I wasn't interested in.


Good idea but all those warnings slow down the compilation a lot. 
Apparently it is just -Wextra that generates these warnings. The -Wall 
option seems OK, so we will still keep a lot of warning if we remove 
-Wextra from the autotools, won't we?


Thanks,
Abdel.





Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Abdelrazak Younes

Abdelrazak Younes a écrit :

Angus Leeming a écrit :

Well, with Qt4, this happens only for "moc/*_moc.C". I had a look at 
qtglobal.h and I saw this:


Small correction, this happens also for files in frontends/qt4/. I 
forgot that I modified the Makefile, sorry.




Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Abdelrazak Younes

Enrico Forestieri a écrit :

On Tue, Apr 11, 2006 at 08:08:32PM +0200, Abdelrazak Younes wrote:
Now that -Wl is passed to g++ (shouldn't it be -Wall by the way?) I have 
an awful lot of warnings. As I don't want Marchall Lastgouttes to catch 
me on that, here is my first report :-), Most of them are:


d:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/stl_uninitialized
.h:82: warning: '__cur' might be used uninitialized in this function

idea?


That's -Wl,--export-all-symbols and simply passes --export-all-symbols
to the linker. It does no good and simply will increase your linking
time. I suggest that you get rid of it.


I don't understand. A typical compil command in src/ would be:

$ g++ -DHAVE_CONFIG_H -I. -I. -I.   -I../boost -Wall -Wextra 
-I/cygdrive/d/program/Aspell-0.60.4/include   -O3 -c -o MenuBackend.o 
MenuBackend.C


These warnings disappear only if I remove "-Wall" _and_ "-Wextra".

If you are sure of what you say about "-Wl,--export-all-symbols", we 
should get rid of these option. Could you give a patch? Sorry, I am not 
proficient at all with autotools.


Thanks Enrico,
Abdel.




Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Enrico Forestieri
On Wed, Apr 12, 2006 at 10:31:58AM +0200, Abdelrazak Younes wrote:
> Enrico Forestieri a écrit :
> >On Tue, Apr 11, 2006 at 08:08:32PM +0200, Abdelrazak Younes wrote:
> >>Now that -Wl is passed to g++ (shouldn't it be -Wall by the way?) I have 
> >>an awful lot of warnings. As I don't want Marchall Lastgouttes to catch 
> >>me on that, here is my first report :-), Most of them are:
> >>
> >>d:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/stl_uninitialized
> >>.h:82: warning: '__cur' might be used uninitialized in this function
> >>
> >>idea?
> >
> >That's -Wl,--export-all-symbols and simply passes --export-all-symbols
> >to the linker. It does no good and simply will increase your linking
> >time. I suggest that you get rid of it.
> 
> I don't understand. A typical compil command in src/ would be:
> 
> $ g++ -DHAVE_CONFIG_H -I. -I. -I.   -I../boost -Wall -Wextra 
> -I/cygdrive/d/program/Aspell-0.60.4/include   -O3 -c -o MenuBackend.o 
> MenuBackend.C
> 
> These warnings disappear only if I remove "-Wall" _and_ "-Wextra".
> 
> If you are sure of what you say about "-Wl,--export-all-symbols", we 
> should get rid of these option. Could you give a patch? Sorry, I am not 
> proficient at all with autotools.

I was not talking about the warnings, sorry for the confusion.
What I said only applies to the final link step. I observed that
with -Wl,--export-all-symbols, the linking time noticeably increases.
Removing that option shortens the linking time for me without any
side effect.

This is a sed command you can use to modify configure in order to
avoid "-Wl,--export-all-symbols" in LDFLAGS:

sed ' 
# Omit -Wl,--export-all-symbols in LDFLAGS
/LDFLAGS=\"\$LDFLAGS 
\$WIN32_LD_EXPORT_ALL_SYMBOLS\"/s/LDFLAGS/true\t\#LDFLAGS/' \
./configure > ./configure-new


-- 
Enrico


Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Abdelrazak Younes

Enrico Forestieri a écrit :

That's -Wl,--export-all-symbols and simply passes --export-all-symbols
to the linker. It does no good and simply will increase your linking
time. I suggest that you get rid of it.

[..]

I was not talking about the warnings, sorry for the confusion.
What I said only applies to the final link step. I observed that
with -Wl,--export-all-symbols, the linking time noticeably increases.
Removing that option shortens the linking time for me without any
side effect.

This is a sed command you can use to modify configure in order to
avoid "-Wl,--export-all-symbols" in LDFLAGS:

sed ' 
# Omit -Wl,--export-all-symbols in LDFLAGS

/LDFLAGS=\"\$LDFLAGS 
\$WIN32_LD_EXPORT_ALL_SYMBOLS\"/s/LDFLAGS/true\t\#LDFLAGS/' \
./configure > ./configure-new


Wouldn't it be better to integrate that fix in the m4 macros? If in 
there that is...


Abdel.



Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Enrico Forestieri
On Wed, Apr 12, 2006 at 02:45:00PM +0200, Abdelrazak Younes wrote:
> Enrico Forestieri a écrit :
> >>>That's -Wl,--export-all-symbols and simply passes --export-all-symbols
> >>>to the linker. It does no good and simply will increase your linking
> >>>time. I suggest that you get rid of it.
> [..]
> >I was not talking about the warnings, sorry for the confusion.
> >What I said only applies to the final link step. I observed that
> >with -Wl,--export-all-symbols, the linking time noticeably increases.
> >Removing that option shortens the linking time for me without any
> >side effect.
> >
> >This is a sed command you can use to modify configure in order to
> >avoid "-Wl,--export-all-symbols" in LDFLAGS:
> >
> >sed ' 
> ># Omit -Wl,--export-all-symbols in LDFLAGS
> >/LDFLAGS=\"\$LDFLAGS 
> >\$WIN32_LD_EXPORT_ALL_SYMBOLS\"/s/LDFLAGS/true\t\#LDFLAGS/' \
> >./configure > ./configure-new
> 
> Wouldn't it be better to integrate that fix in the m4 macros? If in 
> there that is...

Perhaps... But I am not going to propose that, as I have to save
energy for other battles... ;-)

Then, I don't know if this flag is going to help when dynamically
linking Qt, as I must link statically to it. For sure it doesn't
help when dinamically linking the X11 libs or any other library
(I just finished successfully building an X11 version of LyX/Cygwin
without that option and dynamically linking to libAiksaurus,
libaspell, libiconv, libXrandr, libXcursor, libXft, libXrender,
libfontconfig, libfreetype, libexpat, libXext, libSM, libICE,
libX11: The gain in linking time is awesome).

-- 
Enrico


Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-12 Thread Abdelrazak Younes

Enrico Forestieri a écrit :

On Wed, Apr 12, 2006 at 02:45:00PM +0200, Abdelrazak Younes wrote:

Enrico Forestieri a écrit :

That's -Wl,--export-all-symbols and simply passes --export-all-symbols
to the linker. It does no good and simply will increase your linking
time. I suggest that you get rid of it.

[..]

I was not talking about the warnings, sorry for the confusion.
What I said only applies to the final link step. I observed that
with -Wl,--export-all-symbols, the linking time noticeably increases.
Removing that option shortens the linking time for me without any
side effect.

This is a sed command you can use to modify configure in order to
avoid "-Wl,--export-all-symbols" in LDFLAGS:

sed ' 
# Omit -Wl,--export-all-symbols in LDFLAGS
/LDFLAGS=\"\$LDFLAGS 
\$WIN32_LD_EXPORT_ALL_SYMBOLS\"/s/LDFLAGS/true\t\#LDFLAGS/' \

   ./configure > ./configure-new
Wouldn't it be better to integrate that fix in the m4 macros? If in 
there that is...


Perhaps... But I am not going to propose that, as I have to save
energy for other battles... ;-)


Well, if it can help the production of lyx dynamically linked with Qt3 
that would be great because as it is now the linking time is close to 
unbearable. I'll try to test if there's any improvement.


Abdel.



Then, I don't know if this flag is going to help when dynamically
linking Qt, as I must link statically to it. For sure it doesn't
help when dinamically linking the X11 libs or any other library
(I just finished successfully building an X11 version of LyX/Cygwin
without that option and dynamically linking to libAiksaurus,
libaspell, libiconv, libXrandr, libXcursor, libXft, libXrender,
libfontconfig, libfreetype, libexpat, libXext, libSM, libICE,
libX11: The gain in linking time is awesome).




Re: Question about C++ warning (was Re: [Patch] Paragrah creation/deletion optimisation)

2006-04-13 Thread Abdelrazak Younes

Abdelrazak Younes a écrit :
Now that -Wl is passed to g++ (shouldn't it be -Wall by the way?) I have 
an awful lot of warnings. As I don't want Marchall Lastgouttes to catch 
me on that, here is my first report :-), Most of them are:


d:/mingw/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/stl_uninitialized 


.h:82: warning: '__cur' might be used uninitialized in this function


This thread seems to conclude that this is a compiler bug and that the 
only way to get rid of the warning is to pass "-Wno-uninitialized"


http://www.cygwin.com/ml/cygwin-apps/2005-06/msg00159.html

Many other reference on the net seems to have the same conclusion. Could 
someone help me to pass this option for win32 (I presume in cygwin.m4)?


Abdel.



idea?

Abdel.

Abdelrazak Younes a écrit :

Abdelrazak Younes a écrit :

Jean-Marc Lasgouttes a écrit :
"Abdelrazak" == Abdelrazak Younes 
<[EMAIL PROTECTED]> writes:


Abdelrazak> Angus Leeming a écrit :

Abdelrazak Younes <[EMAIL PROTECTED]> writes:

export CXXFLAGS="-Os -Id:/program/Aspell-0.60.4/include"

Replace with CPPFLAGS and you should be all set.


Abdelrazak> Apparently not, at least not in my system. I have the same
Abdelrazak> errors as if don't set CXXFLAGS:

Try CXXCPPFLAGS.


The same...


But using --enable-optimization=-O3 instead of --enable-optimization=3 
and without setting any variable (neither CXXFLAGS nor CPPFLAGS) seems 
to give the correct config:


Configuration
  Host type:  i686-pc-cygwin
  Special build flags:assertions warnings
  C   Compiler:   gcc
  C   Compiler LyX flags:
  C   Compiler flags: -Wextra -Wall 
-I/cygdrive/d/program/Aspell-0.60.4/incl

ude  -O3
  C++ Compiler:   g++ (3.4.4)
  C++ Compiler LyX flags:
  C++ Compiler flags: -Wextra -Wall 
-I/cygdrive/d/program/Aspell-0.60.4/incl

ude  -O3
  Linker flags:
  Linker user flags: -L/cygdrive/d/program/Aspell-0.60.4/lib 
-Wl,--export-al

l-symbols
  Qt 4 Frontend:
  Qt 4 version: 4.1.1
  Packaging:  windows
  LyX binary dir: d:/program/lyx-svn/bin
  LyX files dir:  d:/program/lyx-svn/Resources