bugCompact Disc Input and Control Library - Bugs: bug #48759, Examples built with g++ >5 are...

 
 

bug #48759: Examples built with g++ >5 are failing

Submitted by:  Ivan <isage>
Submitted on:  Thu 11 Aug 2016 05:42:15 PM UTC  
 
Category: run-time errorSeverity: 5 - Average
Item Group: example programsStatus: Fixed
Privacy: PublicAssigned to: Rocky Bernstein <rocky>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 13 Aug 2016 11:28:38 AM UTC, comment #5:

Yep, that definitely fixes it. Thank you.

Ivan <isage>
Fri 12 Aug 2016 11:42:03 PM UTC, comment #4:

> GCC supports #pragma pack(push,1) since 4.0, MSVC and clang supports it too.


Ok. I've put a guard that GCC is greater than 4.0 and removed the check on _STDC_VERSION in commit 47f3fbf3eb0ca1ae1294744e8824d023f32ec756

See if that does it for you, and let me know. If so, I'll close this.

Thanks for tracking down the problem.

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Fri 12 Aug 2016 06:45:53 PM UTC, comment #3:

Question is, is it really needed?
GCC supports #pragma pack(push,1) since 4.0, MSVC and clang supports it too.

Ivan <isage>
Fri 12 Aug 2016 04:57:39 PM UTC, comment #2:

Thanks for reporting the problem and identifying what's going on.

I'd greatly appreciate it if you would submit a patch, and I'll look at and integrate when I have a chance.

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Fri 12 Aug 2016 02:44:33 PM UTC, comment #1:

Okay, found culprit:
http://git.savannah.gnu.org/gitweb/?p=libcdio.git;a=blob;f=include/cdio/types.h;h=d00c35901e84223d9689002db8726a71c0e69304;hb=HEAD#l158

_STDC_VERSION_ is undefined in c++ (as per https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html) which results in packed structs in lib and unpacked in c++ user code.

You should add another #elif clause with __cplusplus macro.

I can confirm, that defining _STDC_VERSION_ in user code fixes garbage output with GCC 5 and 6.

Ivan <isage>
Thu 11 Aug 2016 05:42:15 PM UTC, original submission:

example/C++/isolist.cpp and example/C++/OO/isolist.cpp
both produce garbage instead of filenames, when built with g++ (>5), however, example/isolist.c works fine.

This is on Fedora 23 with gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) and on Fedora 24 with gcc version 6.1.1 20160621 (Red Hat 6.1.1-3) (GCC)

Ivan <isage>

 

(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 rocky (Posted a comment)
  • -unavailable- added by isage (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 25 Mar 2017 09:44:33 AM UTCrockyOpen/ClosedOpen=>Closed
    Fri 12 Aug 2016 11:42:21 PM UTCrockyStatusNone=>Fixed
    Fri 12 Aug 2016 11:42:03 PM UTCrockyAssigned toNone=>rocky

    Back to the top


    Powered by Savane 3.1-cleanup1