bugGnash - The GNU Flash player - Bugs: bug #34911, Coding errors in OpenVG

 
 

bug #34911: Coding errors in OpenVG

Submitter:  Benjamin Wolsey <bwy>
Submitted:  Sun 27 Nov 2011 11:56:50 AM UTC
   
 
Category:  renderer Severity:  3 - Normal
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  rsavoye
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 01 Dec 2011 07:33:55 AM UTC, comment #6: 

Cool, thanks.

Benjamin Wolsey <bwy>
Group Member
Wed 30 Nov 2011 04:13:46 PM UTC, comment #5: 

Fixed as of #2691547. I used boost::scoped_array() instead of a regular C style array.

Rob Savoye <rsavoye>
Group administrator
Wed 30 Nov 2011 10:08:03 AM UTC, comment #4: 

The VLA warning is also from -pedantic, which is certainly another reason to enable it.

Benjamin Wolsey <bwy>
Group Member
Wed 30 Nov 2011 09:29:38 AM UTC, comment #3: 

VLAs have never been allowed in C++, either in the last standard or the new one. As Sandro says they are from C99.

The extra ';' is a warning from -pedantic, which I'd recommend enabling so that little bugs like that can be fixed too.

Benjamin Wolsey <bwy>
Group Member
Wed 30 Nov 2011 06:33:56 AM UTC, comment #2: 

It looks like ISO C99 would allow them but C90 shouldn't
(altought GCC, as an extension, allows that):
http://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html

More info here:
http://stackoverflow.com/questions/5730101/when-are-variable-length-arrays-legal

I think it'd be worth (and easy) to avoid them.
Having warning-clean builds helps finding important ones.

Sandro Santilli <strk>
Group Member
Tue 29 Nov 2011 11:58:00 PM UTC, comment #1: 

Which compiler on which distro ? I don't see these warnings with GCC 4.6.2 on Fedora 16. It's perfectly legit code, I wouldn't call this a coding error at all. Sounds more like a compiler bug.

Rob Savoye <rsavoye>
Group administrator
Sun 27 Nov 2011 11:56:50 AM UTC, original submission:  

Compiler emits following warnings, which should be fixed:

/home/benjamin/Downloads/gnash/broken/librender/openvg/OpenVGBitmap.cpp: In member function 'gnash::renderer::openvg::OpenVGBitmap* gnash::renderer::openvg::OpenVGBitmap::createRadialBitmap(float, float, float, float, float, const gnash::SWFCxForm&, const GradientRecords&, VGPaint)':
/home/benjamin/Downloads/gnash/broken/librender/openvg/OpenVGBitmap.cpp:173:26: warning: ISO C++ forbids variable length array 'ramps' [-Wvla]
/home/benjamin/Downloads/gnash/broken/librender/openvg/OpenVGBitmap.cpp: In member function 'gnash::renderer::openvg::OpenVGBitmap* gnash::renderer::openvg::OpenVGBitmap::createLinearBitmap(float, float, float, float, const gnash::SWFCxForm&, const GradientRecords&, VGPaint)':
/home/benjamin/Downloads/gnash/broken/librender/openvg/OpenVGBitmap.cpp:237:26: warning: ISO C++ forbids variable length array 'ramps' [-Wvla]
/home/benjamin/Downloads/gnash/broken/librender/openvg/OpenVGRenderer.cpp:378:2: warning: extra ';' [-pedantic]

Benjamin Wolsey <bwy>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by rsavoye (Updated the item)
  • -email is unavailable- added by bwy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-01 bwy StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2011-11-30 rsavoye StatusNone Ready For Test
    2011-11-29 rsavoye Severity4 - Important 3 - Normal

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code