Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 8 additions & 20 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -779,24 +779,10 @@ AS_IF([test "x${has_optimizer_flags}" = "xno"],
case $host_os_def in
linux)
AS_IF([test "x$ax_cv_c_compiler_vendor" = "xintel"], [
# -Wall goes crazy, so turned these specific checks off for now:
# -Wall is overzealous for us, so need to turn this off for now:
#
# 111 is "statement is unreachable"
# 279 is "controlling expression is constant", triggered by our asserts
# 383 is "value copied to temporary, reference to temporary used"
# 444 is "destructor for base class is not virtual"
# 522 is "function "xyz" redeclared "inline" after being called
# 873 is "has no corresponding operator delete". ToDo: we should fix.
# 981 is "operands are evaluated in unspecified order"
# 1418 is "external function definition with no prior declaration"
# 1419 is "external declaration in primary source file"
# 1572 is "floating-point equality and inequality comparisons are unreliable"
# 1720 is "operator new" has no corresponding member operator delete"
# 2256 is "non-pointer conversion from "int" to "unsigned char" "
# 2259 is "non-pointer conversion from "int" to "unsigned char" "
#
# TODO: We should try to eliminate more of these -wd exclusions.
common_opt="-pipe -Wall -wd111 -wd279 -wd383 -wd522 -wd444 -wd873 -wd981 -wd1418 -wd1419 -wd1572 -wd1720 -wd2256 -wd2259"
# #873 is "has no corresponding operator delete"
common_opt="-pipe -Wall -wd873"
debug_opt="-ggdb3 $common_opt"
release_opt="-g $common_opt $optimization_flags -axsse4.2 -fno-strict-aliasing"
cxx_opt="-Wno-invalid-offsetof"
Expand Down Expand Up @@ -1333,7 +1319,7 @@ TS_TRY_COMPILE_NO_WARNING([],[
has_128bit_cas=1
], [
dnl If 128bit CAS fails, try again with the -mcx16 option. GCC needs this;
dnl clang doesn't; icc is unknown but presumed sane.
dnl clang doesn't; icc does not support -mcx16 (but gives a non-fatal warning).
TS_ADDTO(CXXFLAGS, [-mcx16])
TS_ADDTO(CFLAGS, [-mcx16])
TS_TRY_COMPILE_NO_WARNING([],[
Expand All @@ -1353,8 +1339,10 @@ AC_LANG_POP
AC_SUBST(has_128bit_cas)

AS_IF([test "x$has_128bit_cas" = "x1"], [
TS_ADDTO(CFLAGS, [-mcx16])
TS_ADDTO(CXXFLAGS, [-mcx16])
AS_IF([test "x$ax_cv_c_compiler_vendor" != "xintel"], [
TS_ADDTO(CFLAGS, [-mcx16])
TS_ADDTO(CXXFLAGS, [-mcx16])
])
])

# Check for POSIX capabilities library.
Expand Down
5 changes: 4 additions & 1 deletion iocore/eventsystem/P_IOBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,8 @@ IOBufferReader::consume(int64_t n)

TS_INLINE char &IOBufferReader::operator[](int64_t i)
{
IOBufferBlock *b = block.get();
static char default_ret = '\0'; // This is just to avoid compiler warnings...
IOBufferBlock *b = block.get();

i += start_offset;
while (b) {
Expand All @@ -694,6 +695,8 @@ TS_INLINE char &IOBufferReader::operator[](int64_t i)
}

ink_release_assert(!"out of range");
// Never used, just to satisfy compilers not undersatnding the fatality of ink_release_assert().
return default_ret;
}

TS_INLINE void
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/I_NetVConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class NetVConnection : public VConnection
public:
// How many bytes have been queued to the OS for sending by haven't been sent yet
// Not all platforms support this, and if they don't we'll return -1 for them
virtual const int64_t
virtual int64_t
outstanding()
{
return -1;
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/P_UnixNetVConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ enum tcp_congestion_control_t { CLIENT_SIDE, SERVER_SIDE };
class UnixNetVConnection : public NetVConnection
{
public:
virtual const int64_t outstanding();
virtual int64_t outstanding();
virtual VIO *do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf);
virtual VIO *do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner = false);

Expand Down
2 changes: 1 addition & 1 deletion iocore/net/UnixNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ UnixNetVConnection::get_data(int id, void *data)
}
}

const int64_t
int64_t
UnixNetVConnection::outstanding()
{
int n;
Expand Down
4 changes: 2 additions & 2 deletions lib/ts/PriorityQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ template <typename T, class Comp = PriorityQueueLess<T>> class PriorityQueue
public:
PriorityQueue() {}
~PriorityQueue() {}
const bool empty();
bool empty();
PriorityQueueEntry<T> *top();
void pop();
void push(PriorityQueueEntry<T> *);
Expand All @@ -72,7 +72,7 @@ PriorityQueue<T, Comp>::dump() const
}

template <typename T, typename Comp>
const bool
bool
PriorityQueue<T, Comp>::empty()
{
return _v.length() == 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/signals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ signal_check_handler(int signal, signal_handler_t handler)
sigact = (void *)oact.sa_sigaction;
}

if (sigact != handler) {
if (sigact != (void *)handler) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No C-style casts! static_cast<void*>(handler) although we should really rethink using void* in this context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did look / try not using void *, but it turns out the sigaction is not the same type as the handler. So some casting would be needed.

And yeh, I'll change to amc style cast, only because you are the best, and currently sitting in the #1 spot on the ranking.

Copy link
Contributor Author

@zwoop zwoop Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm not gonna change this, because everything else in this file (in a many places) uses the C-style cast already.

Warning("handler for signal %d was %p, not %p as expected", signal, sigact, handler);
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/experimental/balancer/hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ sockaddrlen(const struct sockaddr *sa)
default:
TSReleaseAssert(0 && "unsupported socket type");
}

return 0;
}

struct md5_key {
Expand Down
2 changes: 1 addition & 1 deletion plugins/header_rewrite/condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Condition : public Statement
return _matcher;
}

const MatcherOps
MatcherOps
get_cond_op() const
{
return _cond_op;
Expand Down
2 changes: 1 addition & 1 deletion plugins/header_rewrite/operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "ts/ts.h"
#include "operator.h"

const OperModifiers
OperModifiers
Operator::get_oper_modifiers() const
{
if (_next) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/header_rewrite/operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Operator : public Statement
{
public:
Operator() : _mods(OPER_NONE) { TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for Operator"); }
const OperModifiers get_oper_modifiers() const;
OperModifiers get_oper_modifiers() const;
virtual void initialize(Parser &p);

void
Expand Down
4 changes: 2 additions & 2 deletions plugins/header_rewrite/ruleset.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ class RuleSet
_hook = hook;
}

const TSHttpHookID
TSHttpHookID
get_hook() const
{
return _hook;
}

const ResourceIDs
ResourceIDs
get_all_resource_ids() const
{
return _ids;
Expand Down
2 changes: 1 addition & 1 deletion plugins/header_rewrite/statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Statement::append(Statement *stmt)
tmp->_next = stmt;
}

const ResourceIDs
ResourceIDs
Statement::get_resource_ids() const
{
const Statement *stmt = this;
Expand Down
4 changes: 2 additions & 2 deletions plugins/header_rewrite/statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Statement

// Which hook are we adding this statement to?
bool set_hook(TSHttpHookID hook);
const TSHttpHookID
TSHttpHookID
get_hook() const
{
return _hook;
Expand All @@ -124,7 +124,7 @@ class Statement
// Linked list.
void append(Statement *stmt);

const ResourceIDs get_resource_ids() const;
ResourceIDs get_resource_ids() const;

virtual void
initialize(Parser &)
Expand Down
2 changes: 1 addition & 1 deletion proxy/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9246,7 +9246,7 @@ TSUuidInitialize(TSUuid uuid, TSUuidVersion v)
return u->valid() ? TS_SUCCESS : TS_ERROR;
}

const TSUuid
TSUuid
TSProcessUuidGet(void)
{
Machine *machine = Machine::instance();
Expand Down
2 changes: 1 addition & 1 deletion proxy/api/ts/ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@ tsapi TSReturnCode TSUuidStringParse(TSUuid uuid, const char *uuid_str);
tsapi TSReturnCode TSClientRequestUuidGet(TSHttpTxn txnp, char *uuid_str);

/* Get the process global UUID, resets on every startup */
tsapi const TSUuid TSProcessUuidGet(void);
tsapi TSUuid TSProcessUuidGet(void);

/**
Returns the plugin_tag.
Expand Down
4 changes: 2 additions & 2 deletions proxy/http2/Http2Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ class Http2Stream : public ProxyClientTransaction
bytes_sent += num_bytes;
}

const Http2StreamId
Http2StreamId
get_id() const
{
return _id;
}

const Http2StreamState
Http2StreamState
get_state() const
{
return _state;
Expand Down