Skip to content

Commit d407f43

Browse files
committed
Cleans up ICC options, and some build issues
This removes a number of the previous warning exclusions that we we used to do. We then also have to clean up the core code in a few places, sometimes looking slightly odd (e.g. the meaningless const that we have in a few places).
1 parent d122179 commit d407f43

File tree

17 files changed

+31
-39
lines changed

17 files changed

+31
-39
lines changed

configure.ac

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -779,24 +779,10 @@ AS_IF([test "x${has_optimizer_flags}" = "xno"],
779779
case $host_os_def in
780780
linux)
781781
AS_IF([test "x$ax_cv_c_compiler_vendor" = "xintel"], [
782-
# -Wall goes crazy, so turned these specific checks off for now:
782+
# -Wall is overzealous for us, so need to turn this off for now:
783783
#
784-
# 111 is "statement is unreachable"
785-
# 279 is "controlling expression is constant", triggered by our asserts
786-
# 383 is "value copied to temporary, reference to temporary used"
787-
# 444 is "destructor for base class is not virtual"
788-
# 522 is "function "xyz" redeclared "inline" after being called
789-
# 873 is "has no corresponding operator delete". ToDo: we should fix.
790-
# 981 is "operands are evaluated in unspecified order"
791-
# 1418 is "external function definition with no prior declaration"
792-
# 1419 is "external declaration in primary source file"
793-
# 1572 is "floating-point equality and inequality comparisons are unreliable"
794-
# 1720 is "operator new" has no corresponding member operator delete"
795-
# 2256 is "non-pointer conversion from "int" to "unsigned char" "
796-
# 2259 is "non-pointer conversion from "int" to "unsigned char" "
797-
#
798-
# TODO: We should try to eliminate more of these -wd exclusions.
799-
common_opt="-pipe -Wall -wd111 -wd279 -wd383 -wd522 -wd444 -wd873 -wd981 -wd1418 -wd1419 -wd1572 -wd1720 -wd2256 -wd2259"
784+
# #873 is "has no corresponding operator delete"
785+
common_opt="-pipe -Wall -wd873"
800786
debug_opt="-ggdb3 $common_opt"
801787
release_opt="-g $common_opt $optimization_flags -axsse4.2 -fno-strict-aliasing"
802788
cxx_opt="-Wno-invalid-offsetof"
@@ -1333,7 +1319,7 @@ TS_TRY_COMPILE_NO_WARNING([],[
13331319
has_128bit_cas=1
13341320
], [
13351321
dnl If 128bit CAS fails, try again with the -mcx16 option. GCC needs this;
1336-
dnl clang doesn't; icc is unknown but presumed sane.
1322+
dnl clang doesn't; icc does not support -mcx16 (but gives a non-fatal warning).
13371323
TS_ADDTO(CXXFLAGS, [-mcx16])
13381324
TS_ADDTO(CFLAGS, [-mcx16])
13391325
TS_TRY_COMPILE_NO_WARNING([],[
@@ -1353,8 +1339,10 @@ AC_LANG_POP
13531339
AC_SUBST(has_128bit_cas)
13541340

13551341
AS_IF([test "x$has_128bit_cas" = "x1"], [
1356-
TS_ADDTO(CFLAGS, [-mcx16])
1357-
TS_ADDTO(CXXFLAGS, [-mcx16])
1342+
AS_IF([test "x$ax_cv_c_compiler_vendor" != "xintel"], [
1343+
TS_ADDTO(CFLAGS, [-mcx16])
1344+
TS_ADDTO(CXXFLAGS, [-mcx16])
1345+
])
13581346
])
13591347

13601348
# Check for POSIX capabilities library.

iocore/eventsystem/P_IOBuffer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ IOBufferReader::consume(int64_t n)
682682

683683
TS_INLINE char &IOBufferReader::operator[](int64_t i)
684684
{
685-
IOBufferBlock *b = block.get();
685+
static char default_ret[] = "0"; // This is just to avoid compiler warnings...
686+
IOBufferBlock *b = block.get();
686687

687688
i += start_offset;
688689
while (b) {
@@ -694,6 +695,7 @@ TS_INLINE char &IOBufferReader::operator[](int64_t i)
694695
}
695696

696697
ink_release_assert(!"out of range");
698+
return default_ret[0];
697699
}
698700

699701
TS_INLINE void

iocore/net/I_NetVConnection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class NetVConnection : public VConnection
260260
public:
261261
// How many bytes have been queued to the OS for sending by haven't been sent yet
262262
// Not all platforms support this, and if they don't we'll return -1 for them
263-
virtual const int64_t
263+
virtual int64_t
264264
outstanding()
265265
{
266266
return -1;

iocore/net/P_UnixNetVConnection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ enum tcp_congestion_control_t { CLIENT_SIDE, SERVER_SIDE };
103103
class UnixNetVConnection : public NetVConnection
104104
{
105105
public:
106-
virtual const int64_t outstanding();
106+
virtual int64_t outstanding();
107107
virtual VIO *do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf);
108108
virtual VIO *do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner = false);
109109

iocore/net/UnixNetVConnection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ UnixNetVConnection::get_data(int id, void *data)
656656
}
657657
}
658658

659-
const int64_t
659+
int64_t
660660
UnixNetVConnection::outstanding()
661661
{
662662
int n;

lib/ts/PriorityQueue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ template <typename T, class Comp = PriorityQueueLess<T>> class PriorityQueue
4747
public:
4848
PriorityQueue() {}
4949
~PriorityQueue() {}
50-
const bool empty();
50+
bool empty();
5151
PriorityQueueEntry<T> *top();
5252
void pop();
5353
void push(PriorityQueueEntry<T> *);
@@ -72,7 +72,7 @@ PriorityQueue<T, Comp>::dump() const
7272
}
7373

7474
template <typename T, typename Comp>
75-
const bool
75+
bool
7676
PriorityQueue<T, Comp>::empty()
7777
{
7878
return _v.length() == 0;

lib/ts/signals.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ signal_check_handler(int signal, signal_handler_t handler)
4646
sigact = (void *)oact.sa_sigaction;
4747
}
4848

49-
if (sigact != handler) {
49+
if (sigact != (void *)handler) {
5050
Warning("handler for signal %d was %p, not %p as expected", signal, sigact, handler);
5151
return false;
5252
}

plugins/experimental/balancer/hash.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ sockaddrlen(const struct sockaddr *sa)
4343
default:
4444
TSReleaseAssert(0 && "unsupported socket type");
4545
}
46+
47+
return 0;
4648
}
4749

4850
struct md5_key {

plugins/header_rewrite/condition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class Condition : public Statement
101101
return _matcher;
102102
}
103103

104-
const MatcherOps
104+
MatcherOps
105105
get_cond_op() const
106106
{
107107
return _cond_op;

plugins/header_rewrite/operator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "ts/ts.h"
2424
#include "operator.h"
2525

26-
const OperModifiers
26+
OperModifiers
2727
Operator::get_oper_modifiers() const
2828
{
2929
if (_next) {

0 commit comments

Comments
 (0)