lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 3a5c416d 5/6: Reenable a warning and resolve


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 3a5c416d 5/6: Reenable a warning and resolve its cause
Date: Wed, 29 Jun 2022 11:11:35 -0400 (EDT)

branch: master
commit 3a5c416d4e200ab638862570341bd1d6fdce197e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Reenable a warning and resolve its cause
    
    In cases like this:
      location_info(line_num, current - start + 1)
    the second argument is a pointer difference, but its type was 'int'.
    Changing the type to 'long int' would work for LP64, but 'long long int'
    is needed for LLP64.
---
 compiler_gcc_warnings.make | 1 -
 rate_table.cpp             | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/compiler_gcc_warnings.make b/compiler_gcc_warnings.make
index 16adfe4f..29713eaf 100644
--- a/compiler_gcc_warnings.make
+++ b/compiler_gcc_warnings.make
@@ -234,7 +234,6 @@ $(cgicc_objects): gcc_common_extra_warnings += \
 # SOMEDAY !! Address some of these '-Wconversion' issues.
 
 wno_conv_objects := \
-  rate_table.o \
   round_glibc.o \
 
 $(wno_conv_objects): gcc_common_extra_warnings += -Wno-conversion 
-Wfloat-conversion
diff --git a/rate_table.cpp b/rate_table.cpp
index 802d656f..99cfdda0 100644
--- a/rate_table.cpp
+++ b/rate_table.cpp
@@ -338,14 +338,14 @@ char const* table_type_as_string(table_type tt)
 // Represents location in the input, possibly invalid if it's not available.
 struct location_info
 {
-    explicit location_info(int line_num = 0, int position = 0)
+    explicit location_info(int line_num = 0, long long int position = 0)
         :line_num_ {line_num}
         ,position_ {position}
         {
         }
 
-    int const line_num_ = 0;
-    int const position_ = 0;
+    int           const line_num_ = 0;
+    long long int const position_ = 0;
 };
 
 inline



reply via email to

[Prev in Thread] Current Thread [Next in Thread]