[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 08e2d4c 03/16: Truncate sizeof(char*)
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 08e2d4c 03/16: Truncate sizeof(char*) |
Date: |
Thu, 15 Nov 2018 17:37:03 -0500 (EST) |
branch: master
commit 08e2d4ce3ae43fd9a9478f5b5937c1b24c710e59
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Truncate sizeof(char*)
This value is certainly representable as 'int'.
---
getopt.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/getopt.cpp b/getopt.cpp
index f39ae09..d9307d9 100644
--- a/getopt.cpp
+++ b/getopt.cpp
@@ -197,7 +197,7 @@ GetOpt::Initialize(std::string const& a_optstring)
void
GetOpt::exchange(char** argv)
{
- int nonopts_size = (last_nonopt - first_nonopt) * sizeof(char*);
+ int nonopts_size = (last_nonopt - first_nonopt) * (int)sizeof(char*);
// GWC substituted std::malloc() for alloca() and added call to std::free()
below.
// char** temp = static_cast<char**>(alloca(nonopts_size));
char** temp = static_cast<char**>(std::malloc(nonopts_size));
- [lmi-commits] [lmi] master updated (dd60056 -> 89e939b), Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 08e2d4c 03/16: Truncate sizeof(char*),
Greg Chicares <=
- [lmi-commits] [lmi] master 327d53c 06/16: Conditionally suppress selected x86_64-linux-gnu gcc-8 diagnostics, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master a1c1aa0 11/16: Avoid type 'long int', Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 158c2a1 08/16: Suppress x86_64-linux-gnu gcc-8 diagnostics for xmlwrapp, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master db0c484 02/16: Improve default gcc warning options, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master d425a61 10/16: Suppress some 86_64-linux-gnu gcc-8 '-Wconversion' diagnostics, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 9c34f2a 12/16: Don't mix std::size_t with fixed-width integer types, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 89e939b 16/16: Prefer lmi::ssize() to member size(), Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 0c4c5b6 01/16: Improve gcc dialect defaults, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 96dc6f5 07/16: Suppress certain diagnostics for another old boost library, Greg Chicares, 2018/11/15
- [lmi-commits] [lmi] master 5548922 14/16: Avoid gratuitous use of member size(), Greg Chicares, 2018/11/15