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

jio_snprintf and friends are not checked by -Wformat

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Fix
    • P4
    • tbd
    • 11
    • hotspot
    • generic
    • generic

    Description

      jio_snprintf and associated functions take format strings and arguments, but are not annotated as format functions in jvm.h, so the validation performed by gcc's -Wformat are not applied to them. They have the associated attributes on the definitions in the .cpp file, but that's fairly useless.

      HotSpot code can (as of JDK-8196882) instead use os::snprintf and friends, which have the associated attributes declared in os.hpp. It may be that HotSpot code should prefer the os functions.

      However, that doesn't help non-HotSpot code that really does need to use the jio_ functions. And jvm.h doesn't seem to have the kind of platform-dependency layer that allows HotSpot to conditionally provide those attributes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: