Subject: Re: patches for koffice for gcc 3.3.1
To: Jeremy C. Reed <reed@reedmedia.net>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 09/29/2003 22:29:04
On Mon, Sep 29, 2003 at 02:27:14PM -0700, Jeremy C. Reed wrote:
> I needed some patches to build koffice with gcc 3.3.1. (I am using
> gcc3-c++-3.3.1 from pkgsrc.)
> 
> Examples of errors:
> 
> formula.cc:4:23: strstream.h: No such file or directory
> formula.cc: In member function `void QpFormula::floatFuncReal(const char*)':
> formula.cc:477: error: `ostrstream' undeclared (first use this function)
> 
> and
> 
> table.cc: In member function `void
> Table::generateTopLineBorder(QTextStream&,    int)':
> table.cc:171: error: ISO C++ forbids variable-size array `border'
> 
> I assume these patches are fine for older gcc too. Can someone
> test and confirm?
> 
> If these are fine, may I add them?

I don't have any problem with adding these now as a workaround, but
<strstream> is most definitely a non-standard C++ header (it may not
be provided by either the MIPSPro os SunPro compilers, but I can't
really say), so we'll need to revisit this again in the future when
GCC removes this header from their distribution.  The right header to
use is <sstream>, but it provides a completely different "string
stream" class and it's not provided by older GCCs, e.g. 2.95.x.  I
think the right way to do this is to use some #ifdef magic to use
<sstream> if it exists and to use <strstream> as a fallback to help
older GCCs.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>