On Friday 01 February 2008 16:21:23 Abdelrazak Younes wrote:
> José Matos wrote:
> > Hi,
> >     now that gcc 4.3 is in the deep freeze stage, it has been upgraded in
> > rawhide (running development version of Fedora 9).
> >
> >     I have fully compiled lyx yesterday with gcc 4.1 (Fedora skipped gcc
> > 4.2) with no problems. Today after upgrading gcc to the latest 4.3 I need
> > the attached patch to compile lyx.
> >
> >     There are two types of fixes, the first is expected gcc is more stricter
> > in the dependencies between header files and has removed unneeded
> > inclusions. That means that we need to include definitions that were
> > previously indirectly included by other headers.
> >
> >     The other point is the use of find, where I had to fully qualify
> > std::find to avoid gcc confusing it with lyx::find.
>
> That's a regression if you ask me, but adding std:: is fine.

  Regarding gcc I am always cautious to jump on conclusions.

> > I am not sure about this patch and I
> > would appreciate comments. :-)
>
> Index: src/insets/InsetTabular.cpp
> ===================================================================
> --- src/insets/InsetTabular.cpp       (revision 22733)
> +++ src/insets/InsetTabular.cpp       (working copy)
> @@ -61,6 +61,7 @@
>   #include <sstream>
>   #include <iostream>
>   #include <limits>
> +#include <cstring>
>
> It'd be better to get rid of any use of string.h instead.

  strlen
>
> Index: src/graphics/GraphicsParams.cpp
> ===================================================================
> --- src/graphics/GraphicsParams.cpp   (revision 22733)
> +++ src/graphics/GraphicsParams.cpp   (working copy)
> @@ -14,6 +14,7 @@
>
>   #include "Length.h"
>
> +#include <cstdlib>
>
> Same remark.

abs
Or is this coming from other header?

> Index: src/mathed/MathData.cpp
> ===================================================================
> --- src/mathed/MathData.cpp   (revision 22733)
> +++ src/mathed/MathData.cpp   (working copy)
> @@ -37,6 +37,8 @@
>   #include <boost/assert.hpp>
>   #include <boost/next_prior.hpp>
>
> +#include <cstdlib>
>
> ditto.

abs

> Index: src/mathed/MathStream.cpp
> ===================================================================
> --- src/mathed/MathStream.cpp (revision 22733)
> +++ src/mathed/MathStream.cpp (working copy)
> @@ -20,6 +20,7 @@
>   #include "support/docstring.h"
>
>   #include <algorithm>
> +#include <cstring>
>
> ditto.

strlen

> ===================================================================
> --- src/Font.cpp      (revision 22733)
> +++ src/Font.cpp      (working copy)
> @@ -31,6 +31,8 @@
>   #include "support/gettext.h"
>   #include "support/lstrings.h"
>
> +#include <cstring>
>
> ditto.

strlen

> Index: src/frontends/qt4/TocModel.cpp
> ===================================================================
> --- src/frontends/qt4/TocModel.cpp    (revision 22733)
> +++ src/frontends/qt4/TocModel.cpp    (working copy)
> @@ -16,6 +16,7 @@
>   #include "support/debug.h"
>
>   #include <boost/assert.hpp>
> +#include <climits>
>
> ditto. <limits> does not work?

Where is MAX_LEN defined? I think this is C.
It should not be difficult to convert this to <limits> though.

> ===================================================================
> --- src/support/docstream.cpp (revision 22733)
> +++ src/support/docstream.cpp (working copy)
> @@ -15,6 +15,7 @@
>
>   #include <cerrno>
>   #include <cstdio>
> +#include <cstring>
>
>
> ditto.

strerror

> ===================================================================
> --- src/support/minizip/zipunzip.cpp  (revision 22733)
> +++ src/support/minizip/zipunzip.cpp  (working copy)
> @@ -52,6 +52,8 @@
>
>   #include <config.h>
>
> +#include <cstdlib>
> +#include <cstring>
>
> ditto.

strlen
strncpy
strcpy

malloc
free

-- 
José Abílio

Reply via email to