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

 
 

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

Submitter:  Ivan <isage>
Submitted:  Thu 11 Aug 2016 05:42:15 PM UTC
   
 
Category:  run-time error Severity:  5 - Average
Item Group:  example programs Status:  Fixed
Privacy:  Public Assigned to:  rocky
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-25 rocky Open/ClosedOpen Closed
    2016-08-12 rocky StatusNone Fixed
    2016-08-12 rocky Assigned toNone rocky

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code