Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8085975

Fix warning "converting to jlong from double" of gcc 4.1.2 after 8079561

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 9
    • 9
    • hotspot
    • None
    • b72

    Backports

      Description

        Since 8079561 our build with gcc 4.1.2 fails because of "timer.cpp:62: warning: converting to jlong from double".

        This warning is enabled by default in gcc 4.1.2 and can only be turned off by turning off all warnings. We would like to avoid turning off all warnings, though. But because of Werror this breaks the gcc 4.1.2 build.
        The warning can be triggered by setting -Wconversion in gcc 4.8. This triggers a lot of undesired warnings, and thus is off since it got the current semantics in gcc 4.3. In gcc 4.9, the warning can be triggered with less extra noise by -Wfloat-conversion, which seems desireable to be turned on to me.

        All similar code locations are fixed as required by 4.1.2 (e.g., see services/management.cpp:2170 return (jlong)(((double)ticks / (double)os::elapsed_frequency())), therefore I would like to fix this by adding casts.

        Attachments

          Issue Links

            Activity

              People

                goetz Goetz Lindenmaier
                goetz Goetz Lindenmaier
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: