* [PATCH setup 0/2] Fix gcc 6 warnings
@ 2017-10-19 12:21 Jon Turney
2017-10-19 12:21 ` [PATCH setup 2/2] Fix -Werror=misleading-indentation errors seen with gcc 6 Jon Turney
2017-10-19 12:21 ` [PATCH setup 1/2] Fix -Werror=unused-const-variable error " Jon Turney
0 siblings, 2 replies; 3+ messages in thread
From: Jon Turney @ 2017-10-19 12:21 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Jon Turney (2):
Fix -Werror=unused-const-variable error seen with gcc 6
Fix -Werror=misleading-indentation errors seen with gcc 6
libgetopt++/src/OptionSet.cc | 6 ++++--
sha2.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
--
2.14.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH setup 1/2] Fix -Werror=unused-const-variable error seen with gcc 6
2017-10-19 12:21 [PATCH setup 0/2] Fix gcc 6 warnings Jon Turney
2017-10-19 12:21 ` [PATCH setup 2/2] Fix -Werror=misleading-indentation errors seen with gcc 6 Jon Turney
@ 2017-10-19 12:21 ` Jon Turney
1 sibling, 0 replies; 3+ messages in thread
From: Jon Turney @ 2017-10-19 12:21 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
sha2.c:199:24: error: 'sha224_initial_hash_value' defined but not used [-Werror=unused-const-variable=]
---
sha2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sha2.c b/sha2.c
index 4842e42..67251bc 100644
--- a/sha2.c
+++ b/sha2.c
@@ -195,6 +195,7 @@ static const u_int32_t K256[64] = {
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
};
+#if !defined(SHA2_SMALL)
/* Initial hash value H for SHA-224: */
static const u_int32_t sha224_initial_hash_value[8] = {
0xc1059ed8UL,
@@ -206,6 +207,7 @@ static const u_int32_t sha224_initial_hash_value[8] = {
0x64f98fa7UL,
0xbefa4fa4UL
};
+#endif
/* Initial hash value H for SHA-256: */
static const u_int32_t sha256_initial_hash_value[8] = {
--
2.14.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH setup 2/2] Fix -Werror=misleading-indentation errors seen with gcc 6
2017-10-19 12:21 [PATCH setup 0/2] Fix gcc 6 warnings Jon Turney
@ 2017-10-19 12:21 ` Jon Turney
2017-10-19 12:21 ` [PATCH setup 1/2] Fix -Werror=unused-const-variable error " Jon Turney
1 sibling, 0 replies; 3+ messages in thread
From: Jon Turney @ 2017-10-19 12:21 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
This looks like an actual bug which has been lurking here since forever,
fortunately not exposed since hardly anything uses Option::Optional...
libgetopt++/src/OptionSet.cc: In member function 'void OptionSet::doOption(std::__cxx11::string&, const size_type&)':
libgetopt++/src/OptionSet.cc:125:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
if (!isOption(maybepos))
^~
libgetopt++/src/OptionSet.cc:128:8: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
argv.erase(argv.begin() + 1);
^~~~
libgetopt++/src/OptionSet.cc:159:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
if (!isOption(maybepos))
^~
libgetopt++/src/OptionSet.cc:161:8: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
argv.erase(argv.begin() + 1);
^~~~
---
libgetopt++/src/OptionSet.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libgetopt++/src/OptionSet.cc b/libgetopt++/src/OptionSet.cc
index f57b89a..81ffeae 100644
--- a/libgetopt++/src/OptionSet.cc
+++ b/libgetopt++/src/OptionSet.cc
@@ -122,10 +122,11 @@ OptionSet::doOption(string &option, string::size_type const &pos)
if (argv.size() > 1) {
string::size_type maybepos = argv[1].find_first_not_of("-");
- if (!isOption(maybepos))
+ if (!isOption(maybepos)) {
/* not an option */
value = argv[1];
argv.erase(argv.begin() + 1);
+ }
}
} else {
/* value if present is in this argv */
@@ -156,9 +157,10 @@ OptionSet::doOption(string &option, string::size_type const &pos)
if (argv.size() > 1) {
string::size_type maybepos = argv[1].find_first_not_of("-");
- if (!isOption(maybepos))
+ if (!isOption(maybepos)) {
value = argv[1];
argv.erase(argv.begin() + 1);
+ }
}
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-19 12:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 12:21 [PATCH setup 0/2] Fix gcc 6 warnings Jon Turney
2017-10-19 12:21 ` [PATCH setup 2/2] Fix -Werror=misleading-indentation errors seen with gcc 6 Jon Turney
2017-10-19 12:21 ` [PATCH setup 1/2] Fix -Werror=unused-const-variable error " Jon Turney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).