sandialabs / seacas

The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.
Other
132 stars 79 forks source link

-Wreserved-identifier warnings in public API names #419

Closed seanm closed 10 months ago

seanm commented 10 months ago

VTK almost builds cleanly with clang's -Wreserved-identifier. Some of the remaining warnings are from seacas, ex:

/Users/builder/external/VTK/ThirdParty/ioss/vtkioss/Ioss_Map.h:105:13: warning: identifier 'global_to_local__' is reserved because it contains '__' [-Wreserved-identifier]

This warning is admittedly very pedantic, but it's often easy to fix with a simple rename. I was going to do so, but noticed many of the symbols in question are public. So not sure how to proceed...

gsjaardema commented 10 months ago

I thought that most were in the private section of the classes, so renaming should be fine. I will see if there are any in the public sections... If you have a list of the public ones, you could add to this issues.

seanm commented 10 months ago

Well the one quoted (global_to_local__) is in a public section.

I guess we could do a renaming, then do something like:

#define global_to_local__ new_name_for_global_to_local

to provide backwards compatibility.

gsjaardema commented 10 months ago

global_to_local__ is in the private section of the Ioss::Map and Ioss::DatabaseIO classes in my code...

gsjaardema commented 10 months ago

There are a couple xx__ in the public section of Iocgns::DatabaseIO, but I think they are just misplaced and can be moved to private...

gsjaardema commented 10 months ago

Starting a PR to address this #420

seanm commented 10 months ago

global_to_local__ is in the private section of the Ioss::Map and Ioss::DatabaseIO classes in my code...

OK, I didn't look very deeply. I just see it under a public: section:

  class IOCGNS_EXPORT DatabaseIO : public Ioss::DatabaseIO
  {
  public:

  [... snip ...]

    int64_t node_global_to_local__(int64_t global, bool must_exist) const override;

Thanks for starting the PR!

gsjaardema commented 10 months ago

I think the reference PR solves the issue. Please reopen if still problems.