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

 
 

bug #34911: Coding errors in OpenVG

Submitted by:  Benjamin Wolsey <bwy>
Submitted on:  Sun 27 Nov 2011 11:56:50 AM UTC  
 
Category: rendererSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: Rob Savoye <rsavoye>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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

Cool, thanks.

Benjamin Wolsey <bwy>
Project 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>
Project AdministratorIn charge of this item.
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>
Project 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>
Project 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>
Project 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>
Project AdministratorIn charge of this item.
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>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 01 Dec 2011 07:33:55 AM UTCbwyStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 30 Nov 2011 04:13:46 PM UTCrsavoyeStatusNone=>Ready For Test
    Tue 29 Nov 2011 11:58:00 PM UTCrsavoyeSeverity4 - Important=>3 - Normal

    Back to the top


    Powered by Savane 3.1-cleanup1