[lld] 46dc3d0 - [lld] Fix gcc compiler warnings related to variadic macro [NFC]

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 01:34:13 PST 2023


Author: Mikael Holmen
Date: 2023-02-02T10:26:56+01:00
New Revision: 46dc3d0b9b70bbe5def0c404975a3775976122b7

URL: https://github.com/llvm/llvm-project/commit/46dc3d0b9b70bbe5def0c404975a3775976122b7
DIFF: https://github.com/llvm/llvm-project/commit/46dc3d0b9b70bbe5def0c404975a3775976122b7.diff

LOG: [lld] Fix gcc compiler warnings related to variadic macro [NFC]

gcc warned like
 ../../lld/ELF/InputSection.cpp:75:37: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
    75 |     invokeELFT(parseCompressedHeader);
       |                                     ^

Added: 
    

Modified: 
    lld/ELF/Driver.cpp
    lld/ELF/InputSection.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index f2b9451aea3a4..fe403962a3858 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -2790,10 +2790,10 @@ void LinkerDriver::link(opt::InputArgList &args) {
     ctx.inputSections.push_back(createCommentSection());
 
   // Split SHF_MERGE and .eh_frame sections into pieces in preparation for garbage collection.
-  invokeELFT(splitSections);
+  invokeELFT(splitSections,);
 
   // Garbage collection and removal of shared symbols from unused shared objects.
-  invokeELFT(markLive);
+  invokeELFT(markLive,);
   demoteSharedAndLazySymbols();
 
   // Make copies of any input sections that need to be copied into each
@@ -2802,7 +2802,7 @@ void LinkerDriver::link(opt::InputArgList &args) {
 
   // Create synthesized sections such as .got and .plt. This is called before
   // processSectionCommands() so that they can be placed by SECTIONS commands.
-  invokeELFT(createSyntheticSections);
+  invokeELFT(createSyntheticSections,);
 
   // Some input sections that are used for exception handling need to be moved
   // into synthetic sections. Do that now so that they aren't assigned to
@@ -2843,7 +2843,7 @@ void LinkerDriver::link(opt::InputArgList &args) {
   // ICF runs after processSectionCommands() so that we know the output sections.
   if (config->icf != ICFLevel::None) {
     invokeELFT(findKeepUniqueSections, args);
-    invokeELFT(doIcf);
+    invokeELFT(doIcf,);
   }
 
   // Read the callgraph now that we know what was gced or icfed
@@ -2851,9 +2851,9 @@ void LinkerDriver::link(opt::InputArgList &args) {
     if (auto *arg = args.getLastArg(OPT_call_graph_ordering_file))
       if (std::optional<MemoryBufferRef> buffer = readFile(arg->getValue()))
         readCallGraph(*buffer);
-    invokeELFT(readCallGraphsFromObjectFiles);
+    invokeELFT(readCallGraphsFromObjectFiles,);
   }
 
   // Write the result to the file.
-  invokeELFT(writeResult);
+  invokeELFT(writeResult,);
 }

diff  --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index df24f998bff60..879129db335b1 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -72,7 +72,7 @@ InputSectionBase::InputSectionBase(InputFile *file, uint64_t flags,
   // If SHF_COMPRESSED is set, parse the header. The legacy .zdebug format is no
   // longer supported.
   if (flags & SHF_COMPRESSED)
-    invokeELFT(parseCompressedHeader);
+    invokeELFT(parseCompressedHeader,);
 }
 
 // Drop SHF_GROUP bit unless we are producing a re-linkable object file.


        


More information about the llvm-commits mailing list