Bug 812156 - slice2cpp generates bad code
Summary: slice2cpp generates bad code
Alias: None
Product: Fedora
Classification: Fedora
Component: ice
Version: 17
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Haïkel Guémar
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-04-12 22:47 UTC by Matthew Woehlke
Modified: 2012-06-26 00:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-06-26 00:40:14 UTC
Type: Bug

Attachments (Terms of Use)
patch to fix generation of bad float constants (742 bytes, patch)
2012-04-13 23:15 UTC, Matthew Woehlke
no flags Details | Diff

Description Matthew Woehlke 2012-04-12 22:47:22 UTC
Description of problem:
There is an apparent bug in slice2cpp, in that it generates code like '0F' for float constants, which is not valid C++.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Define an ICE class with a float member having a default value.
2. Attempt to compile the resulting code.
Actual results:
error: invalid suffix "F" on integer constant

Expected results:

Additional info:
This appears to be fixed upstream (see http://www.zeroc.com/forums/bug-reports/5431-default-vaules-slice.html), however that doesn't help that ICE in Fedora 17 is not usable. Please either update ICE to a later version or backport the fix for 3.4.2.

Comment 1 Haïkel Guémar 2012-04-13 00:08:12 UTC
> Please either update ICE to a later version or backport the fix for 3.4.2.

Ice 3.4.2 is the latest release available and there is no public source repository, so neither of these options is possible.
Nonetheless I'll look forward patching slice2cpp.

Comment 2 Matthew Woehlke 2012-04-13 23:15:41 UTC
Created attachment 577432 [details]
patch to fix generation of bad float constants

Thanks, and it is indeed unfortunate there is no public repository :-(.

If it helps, the patch I ended up applying locally is attached. I'm not convinced it is optimal, but it seems to do the trick for my project.

Comment 3 Fedora Update System 2012-04-17 07:12:16 UTC
ice-3.4.2-12.fc17 has been submitted as an update for Fedora 17.

Comment 4 Haïkel Guémar 2012-04-17 07:17:37 UTC
@Matthew: thanks for sharing your patch, i made a little change since value is already a std::string so no need to convert it.

Comment 5 Fedora Update System 2012-04-18 22:10:14 UTC
Package ice-3.4.2-12.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ice-3.4.2-12.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 6 Mary Ellen Foster 2012-04-19 09:00:02 UTC
Is it possible to push this fix to F16 as well?

And it might be worth posting the patch on http://www.zeroc.com/forums/patches/ to make sure that it gets into subsequent versions of Ice.

Comment 7 Mary Ellen Foster 2012-04-19 09:00:41 UTC
Oops, I see that the patch actually came from upstream :)

Comment 8 Matthew Woehlke 2012-04-20 20:17:22 UTC
Looks like -12 is missing the line in the .spec to apply the patch?

Comment 9 Mary Ellen Foster 2012-05-18 11:15:49 UTC
There's a typo in the patch included in the current srpm -- there's an extra ")" at the end of one line. If you fix that, then it applies properly and fixes the issue.

Comment 10 Fedora Update System 2012-05-28 08:35:33 UTC
ice-3.4.2-13.fc17 has been submitted as an update for Fedora 17.

Comment 11 Fedora Update System 2012-05-29 15:38:13 UTC
ice-3.4.2-14.fc17 has been submitted as an update for Fedora 17.

Comment 12 Fedora Update System 2012-06-12 13:57:54 UTC
ice-3.4.2-15.fc17 has been submitted as an update for Fedora 17.

Comment 13 Fedora Update System 2012-06-26 00:40:14 UTC
ice-3.4.2-15.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.