[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
- [lmi-commits] [lmi] master updated (01aa1fd4 -> cf4a05dc), Greg Chicares, 2022/06/29
- [lmi-commits] [lmi] master b4fcdefc 1/6: Fix defect introduced 20220525T0000Z: careless pasting, Greg Chicares, 2022/06/29
- [lmi-commits] [lmi] master 3a5c416d 5/6: Reenable a warning and resolve its cause,
Greg Chicares <=
- [lmi-commits] [lmi] master 48a9920b 2/6: Fix defect introduced 20201007T2134Z: dead code, Greg Chicares, 2022/06/29
- [lmi-commits] [lmi] master e7a672bf 4/6: Refactor, Greg Chicares, 2022/06/29
- [lmi-commits] [lmi] master 3d6bbdc6 3/6: Fix defect introduced 20200608T2219Z: dead code, Greg Chicares, 2022/06/29
- [lmi-commits] [lmi] master cf4a05dc 6/6: Remove a class of gcc-warning exceptions, Greg Chicares, 2022/06/29