Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6502 closed Bugs (invalid)

Many warnings when using Intel compiler

Reported by: anonymous Owned by: Eric Niebler
Milestone: To Be Determined Component: proto
Version: Boost Development Trunk Severity: Cosmetic
Keywords: Cc:

Description

When using icc 12 on Linux, I get two warnings very fequently (this is not the exact text):

  • #411, no constructor in boost::proto::expr to initialize reference members
  • #2536, useless const qualifier on return type

I suppose #2536 is actually wrong, it's not useless and it's a trick that Proto uses (right?)

I'm not sure about #411 though.

Change History (3)

comment:1 by Mathias Gaunard, 11 years ago

I was the one who submitted that bug, it appears I didn't log in properly.

Last edited 11 years ago by Mathias Gaunard (previous) (diff)

comment:2 by Eric Niebler, 11 years ago

Resolution: invalid
Status: newclosed

Warning 2536 is certainly wrong. By const-qualifying temporary expressions, I guarantee that they can be bound to arguments of function templates that are non-const references; that is, in the code below, the type T is deduced to be S const.

struct S {};
S const make_S() { return S(); }
template<typename T> void fun(T & t) {}
int main() {
  fun(make_S());
}

Had make_S not returned a const-qualified value, it could not have been passed to fun. Proto uses this trick to eliminate superflous overloads.

As for warning 411, there is no problem I know of with putting references in structs and initializing them with aggregate initialization instead of with constructors. In fact, adding a constructor to Proto's expression types would make them non-POD, voiding any guarantees about static construction.

If you can tell me how to push/pop/disable warnings (like msvc), I can see about cleaning up the spew. Otherwise, we're just going to have to live with it. :-(

Closing as invalid for now.

comment:3 by Mathias Gaunard, 11 years ago

I believe icc supports the same syntax as msvc to disable warnings. I'll try to make a patch.

Note: See TracTickets for help on using tickets.