Bug 812156 - slice2cpp generates bad code
slice2cpp generates bad code
Product: Fedora
Classification: Fedora
Component: ice (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Haïkel Guémar
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-04-12 18:47 EDT by Matthew Woehlke
Modified: 2012-06-25 20:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-25 20:40:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Matthew Woehlke 2012-04-12 18:47:22 EDT
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-12 20:08:12 EDT
> 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 19:15:41 EDT
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 03:12:16 EDT
ice-3.4.2-12.fc17 has been submitted as an update for Fedora 17.
Comment 4 Haïkel Guémar 2012-04-17 03:17:37 EDT
@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 18:10:14 EDT
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 05:00:02 EDT
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 05:00:41 EDT
Oops, I see that the patch actually came from upstream :)
Comment 8 Matthew Woehlke 2012-04-20 16:17:22 EDT
Looks like -12 is missing the line in the .spec to apply the patch?
Comment 9 Mary Ellen Foster 2012-05-18 07:15:49 EDT
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 04:35:33 EDT
ice-3.4.2-13.fc17 has been submitted as an update for Fedora 17.
Comment 11 Fedora Update System 2012-05-29 11:38:13 EDT
ice-3.4.2-14.fc17 has been submitted as an update for Fedora 17.
Comment 12 Fedora Update System 2012-06-12 09:57:54 EDT
ice-3.4.2-15.fc17 has been submitted as an update for Fedora 17.
Comment 13 Fedora Update System 2012-06-25 20:40:14 EDT
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.