PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Disable unreachable warnings?

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
benkirk



Joined: 21 Oct 2004
Posts: 2

PostPosted: Thu Apr 25, 2013 10:48 am    Post subject: Disable unreachable warnings? Reply with quote

Is it possible to disable unreachable code warnings?

Sometimes they are necessary, and being overwhelmed with unnecessary warnings masks the important stuff. Consider

Code:

inline
unsigned int Elem::which_child_am_i (const Elem* e) const
{
  for (unsigned int c=0; c<this->n_children(); c++)
    if (this->child(c) == e)
      return c;

  libMesh::err << "ERROR:  which_child_am_i() was called with a non-child!"
           << std::endl;

  libmesh_error();

  return libMesh::invalid_uint;
}


I get a warnign that the last line is unreachable because libmesh_error(); invokes an abort. Yes, it is unreachable, but also necessary since the function has to return something. I looked at the man page and couldn't easily find an option to suppress such warnings...
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 4996
Location: The Portland Group Inc.

PostPosted: Mon Apr 29, 2013 9:48 am    Post subject: Reply with quote

Hi benkrik,

"-w" or "-Minform=severe" disable warnings, but there is not a method to suppress a particular warning.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group