Summary: | Cannot compile table.cc with gcc 3.3.1 | ||
---|---|---|---|
Product: | kword | Reporter: | Aaron Williams <aaronw> |
Component: | general | Assignee: | Thomas Zander <zander> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.5 or before | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Solaris | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Patch for table.cc in koffice-1.2.1 |
Description
Aaron Williams
2003-08-18 21:11:18 UTC
Created attachment 2280 [details] Patch for table.cc in koffice-1.2.1 I got similar messages compiling koffice-1.3beta3 with gcc-3.3.1 today. Here is what I found: 1. GCC behaviour changed between 3.2.1 and 3.3.1 Variable-length arrays (an extension to GCC) used to produce a warning upon compilation. They now produce an error and compilation (i.e 'make' stops). Note that reporting an error is the right thing to do, so this is fixing a faulty behaviour on GCC 3.2. Example code producing this behaviour: int getnb(void){ int a=3; return a; } int main (int argc, char *argv[]) { bool a[getnb()]; return 1; } With GCC 3.2.1: $gcc -pedantic a.cc a.cc: In function `int main(int, char**)': a.cc:4: warning: ISO C++ forbids variable-size array `a' $echo $? 0 With GCC 3.3.1: $gcc -pedantic a.cc a.cc: In function `int main(int, char**)': a.cc:4: error: ISO C++ forbids variable-size array `a' $echo $? 1 2. Koffice has fixed this PARTIALLY between koffice-1.2.1 and 1.3beta3 a) The offending code in filters/kword/latex/export/table.cc has been fixed, i.e the variable-length array has been replaced by a QBitArray. I include here a patch that should fix it in koffice-1.2.1 (there are other modifications in this file between 1.2.1 and 1.3beta3, I include in the patch only those related to fixing this bug). b) However, a NEW export filter has appeared in 1.3beta3 in filters/kspread/latex/export/table.cc, and unfortunately this one still has the faulty variable-length array. For this last one, I have submitted a new bug report (because it affects koffice-1.3beta3 and not 1.2.1) and a patch that fixes koffice-1.3beta3. It is bug# 62984. Subject: Re: Cannot compile table.cc with gcc 3.3.1 On Wednesday 20 August 2003 00:13, you wrote: > 2. Koffice has fixed this PARTIALLY between koffice-1.2.1 and 1.3beta3 > a) The offending code in filters/kword/latex/export/table.cc has been fixed, > i.e the variable-length array has been replaced by a QBitArray. > I include here a patch that should fix it in koffice-1.2.1 Thanks for that patch - it might be useful to some users. However since there will be no new release of the 1.2-branch, there isn't much point in applying this to CVS. What matters more is to fix the HEAD branch (future 1.3). > b) However, a NEW export filter has appeared in 1.3beta3 in > filters/kspread/latex/export/table.cc, and unfortunately this one still has the > faulty variable-length array. > For this last one, I have submitted a new bug report (because it affects > koffice-1.3beta3 and not 1.2.1) and a patch that fixes koffice-1.3beta3. > It is bug# 62984. Thanks, I'll have a look. |