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

[jdk8u] fail to build hotspot with gcc-8.4.0 with or without COMPILER_WARNINGS_FATAL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • gcc version 8.4.0 (GCC)

       

      No matter what value of COMPILER_WARNINGS_FATAL is set,
      "make image" failed with following error (gcc warnings) with gcc-8.4.0

       ==========
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3848:14: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
             strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3848:61: note: length computed here
             strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
                                                             ~~~~~~^~~~~~~~~~~~~~~~~~~
      Compiling /home/lzang1/Source/jdk8u/hotspot/src/share/vm/oops/arrayOop.cpp
      Compiling /home/lzang1/Source/jdk8u/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp: In static member function 'static void Arguments::fix_appclasspath()':
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
           strncpy(copy, src, strlen(src) + 1);
           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:30: note: length computed here
           strncpy(copy, src, strlen(src) + 1);
                              ~~~~~~^~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
           strncpy(copy, src, strlen(src) + 1);
           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:30: note: length computed here
           strncpy(copy, src, strlen(src) + 1);

            lzang Lin Zang
            lzang Lin Zang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: