[llvm] 20150da - [llvm-c-test] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 08:07:49 PDT 2024


Author: Kazu Hirata
Date: 2024-09-20T08:07:42-07:00
New Revision: 20150daafec2d44de1ea8ec6f69ac452cc5d5c1a

URL: https://github.com/llvm/llvm-project/commit/20150daafec2d44de1ea8ec6f69ac452cc5d5c1a
DIFF: https://github.com/llvm/llvm-project/commit/20150daafec2d44de1ea8ec6f69ac452cc5d5c1a.diff

LOG: [llvm-c-test] Fix warnings

This patch fixes:

  llvm/tools/llvm-c-test/debuginfo.c:254:20: error: unused variable
  'AddDbgRecordLast' [-Werror,-Wunused-variable]

  llvm/tools/llvm-c-test/debuginfo.c:257:20: error: unused variable
  'AddDbgRecordOverTheRange' [-Werror,-Wunused-variable]

  llvm/tools/llvm-c-test/debuginfo.c:264:20: error: unused variable
  'AddDbgRecordUnderTheRange' [-Werror,-Wunused-variable]

Added: 
    

Modified: 
    llvm/tools/llvm-c-test/debuginfo.c

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-c-test/debuginfo.c b/llvm/tools/llvm-c-test/debuginfo.c
index f025f0d32e5181..942cbe5e5900e4 100644
--- a/llvm/tools/llvm-c-test/debuginfo.c
+++ b/llvm/tools/llvm-c-test/debuginfo.c
@@ -253,10 +253,12 @@ int llvm_test_dibuilder(void) {
   assert(AddDbgRecordSecond != NULL);
   LLVMDbgRecordRef AddDbgRecordLast = LLVMGetLastDbgRecord(Add);
   assert(AddDbgRecordLast != NULL);
+  (void)AddDbgRecordLast;
   assert(AddDbgRecordSecond == AddDbgRecordLast);
   LLVMDbgRecordRef AddDbgRecordOverTheRange =
       LLVMGetNextDbgRecord(AddDbgRecordSecond);
   assert(AddDbgRecordOverTheRange == NULL);
+  (void)AddDbgRecordOverTheRange;
   LLVMDbgRecordRef AddDbgRecordFirstPrev =
       LLVMGetPreviousDbgRecord(AddDbgRecordSecond);
   assert(AddDbgRecordFirstPrev != NULL);
@@ -264,6 +266,7 @@ int llvm_test_dibuilder(void) {
   LLVMDbgRecordRef AddDbgRecordUnderTheRange =
       LLVMGetPreviousDbgRecord(AddDbgRecordFirstPrev);
   assert(AddDbgRecordUnderTheRange == NULL);
+  (void)AddDbgRecordUnderTheRange;
 
   char *MStr = LLVMPrintModuleToString(M);
   puts(MStr);


        


More information about the llvm-commits mailing list