Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling with clang gives: object backing the pointer will be destroyed at the end of the full-expression #218

Open
mingodad opened this issue Nov 15, 2022 · 2 comments
Assignees

Comments

@mingodad
Copy link

make[6]: Entering directory '/tmp/build-dad/src/frontend/SageIII'
...
Cxx_GrammarCopyMemberFunctions.C:11535:71: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateArgumentPtrList::const_iterator source_args_iterator = get_args().begin(); 
                                                                      ^~~~~~~~~~
Cxx_GrammarCopyMemberFunctions.C:11553:64: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateArgumentPtrList::const_iterator args_iterator = result->get_args().begin(); 
                                                               ^~~~~~~~~~~~~~~~~~
Cxx_GrammarCopyMemberFunctions.C:11750:72: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateParameterPtrList::const_iterator source_args_iterator = get_args().begin(); 
                                                                       ^~~~~~~~~~
Cxx_GrammarCopyMemberFunctions.C:11768:65: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateParameterPtrList::const_iterator args_iterator = result->get_args().begin(); 
                                                                ^~~~~~~~~~~~~~~~~~
@mingodad
Copy link
Author

Also:

make[6]: Entering directory '/tmp/build-dad/src/midend/programAnalysis'
...
rose/src/midend/programAnalysis/genericDataflow/simpleAnalyses/liveDeadVarAnalysis.C:1203:50: warning: base class 'VarsExprsProductLattice' is uninitialized when used here to access 'VarsExprsProductLattice::filter' [-Wuninitialized]
                VarsExprsProductLattice(n, state,filter)
                                                 ^
rose/src/midend/programAnalysis/genericDataflow/simpleAnalyses/liveDeadVarAnalysis.C:1257:50: warning: base class 'VarsExprsProductLattice' is uninitialized when used here to access 'VarsExprsProductLattice::filter' [-Wuninitialized]
                VarsExprsProductLattice(n, state,filter)
                                                 ^
...
make[4]: Entering directory '/tmp/build-dad/src/midend'
...
  CXX      astMatching/AstMatching.lo
rose/src/midend/astProcessing/AstSharedMemoryParallelSimpleProcessing.C:13:5: warning: "POSIX threads are unavailable on this platform" // blame initial commit [-W#warnings]
#   warning "POSIX threads are unavailable on this platform" // blame initial commit
    ^
...
  CXX      astUtil/astInterface/AstInterface.lo
In file included from rose/src/midend/astRewriteMechanism/rewriteTemplateInstantiations.C:3:
In file included from rose/src/midend/astRewriteMechanism/rewriteTemplateImpl.h:7:
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: warning: instantiation of variable 'AbstractInterfaceNodeCollection<MidLevelCollectionTypedefs>::markerStrings' required here, but no definition is available [-Wundefined-var-template]
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
rose/src/midend/astRewriteMechanism/rewrite.h:407:39: note: forward declaration of template entity is here
          static MarkerCollectionType markerStrings;
                                      ^
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: note: add an explicit instantiation declaration to suppress this warning if 'AbstractInterfaceNodeCollection<MidLevelCollectionTypedefs>::markerStrings' is explicitly instantiated in another translation unit
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: warning: instantiation of variable 'AbstractInterfaceNodeCollection<HighLevelCollectionTypedefs>::markerStrings' required here, but no definition is available [-Wundefined-var-template]
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
rose/src/midend/astRewriteMechanism/rewrite.h:407:39: note: forward declaration of template entity is here
          static MarkerCollectionType markerStrings;
                                      ^
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: note: add an explicit instantiation declaration to suppress this warning if 'AbstractInterfaceNodeCollection<HighLevelCollectionTypedefs>::markerStrings' is explicitly instantiated in another translation unit
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
...
make[6]: Entering directory '/tmp/build-dad/src/roseExtensions/roseHPCToolkit/src/xml2profir'
...
  CXX      query.lo
In file included from rose/src/roseExtensions/roseHPCToolkit/src/xml2profir/process.cc:24:
In file included from rose/src/roseExtensions/roseHPCToolkit/include/rosehpct/rosehpct.hh:38:
rose/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage/sage.hh:89:33: warning: address of stack memory associated with local variable 'result' returned [-Wreturn-stack-address]
      return const_cast<char *>(result.c_str());
                                ^~~~~~

@matzke1 matzke1 self-assigned this Nov 16, 2022
@matzke1
Copy link
Contributor

matzke1 commented Nov 16, 2022

These warnings are delegated to the next ROSE developer (Tristan):

make[6]: Entering directory '/tmp/build-dad/src/frontend/SageIII'
...
Cxx_GrammarCopyMemberFunctions.C:11535:71: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateArgumentPtrList::const_iterator source_args_iterator = get_args().begin(); 
                                                                      ^~~~~~~~~~
Cxx_GrammarCopyMemberFunctions.C:11553:64: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateArgumentPtrList::const_iterator args_iterator = result->get_args().begin(); 
                                                               ^~~~~~~~~~~~~~~~~~
Cxx_GrammarCopyMemberFunctions.C:11750:72: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateParameterPtrList::const_iterator source_args_iterator = get_args().begin(); 
                                                                       ^~~~~~~~~~
Cxx_GrammarCopyMemberFunctions.C:11768:65: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
     SgTemplateParameterPtrList::const_iterator args_iterator = result->get_args().begin(); 
                                                                ^~~~~~~~~~~~~~~~~~

and also

make[4]: Entering directory '/tmp/build-dad/src/midend'
...
  CXX      astMatching/AstMatching.lo
rose/src/midend/astProcessing/AstSharedMemoryParallelSimpleProcessing.C:13:5: warning: "POSIX threads are unavailable on this platform" // blame initial commit [-W#warnings]
#   warning "POSIX threads are unavailable on this platform" // blame initial commit
    ^
...
  CXX      astUtil/astInterface/AstInterface.lo
In file included from rose/src/midend/astRewriteMechanism/rewriteTemplateInstantiations.C:3:
In file included from rose/src/midend/astRewriteMechanism/rewriteTemplateImpl.h:7:
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: warning: instantiation of variable 'AbstractInterfaceNodeCollection<MidLevelCollectionTypedefs>::markerStrings' required here, but no definition is available [-Wundefined-var-template]
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
rose/src/midend/astRewriteMechanism/rewrite.h:407:39: note: forward declaration of template entity is here
          static MarkerCollectionType markerStrings;
                                      ^
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: note: add an explicit instantiation declaration to suppress this warning if 'AbstractInterfaceNodeCollection<MidLevelCollectionTypedefs>::markerStrings' is explicitly instantiated in another translation unit
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: warning: instantiation of variable 'AbstractInterfaceNodeCollection<HighLevelCollectionTypedefs>::markerStrings' required here, but no definition is available [-Wundefined-var-template]
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^
rose/src/midend/astRewriteMechanism/rewrite.h:407:39: note: forward declaration of template entity is here
          static MarkerCollectionType markerStrings;
                                      ^
rose/src/midend/astRewriteMechanism/ASTFragmentCollectorTraversalImpl.h:355:50: note: add an explicit instantiation declaration to suppress this warning if 'AbstractInterfaceNodeCollection<HighLevelCollectionTypedefs>::markerStrings' is explicitly instantiated in another translation unit
          if (markerString == ASTNodeCollection::markerStrings[i][startOrEnd])
                                                 ^

The following warnings will not be fixed because we're planning to remove this code in the near future:

make[6]: Entering directory '/tmp/build-dad/src/midend/programAnalysis'
...
rose/src/midend/programAnalysis/genericDataflow/simpleAnalyses/liveDeadVarAnalysis.C:1203:50: warning: base class 'VarsExprsProductLattice' is uninitialized when used here to access 'VarsExprsProductLattice::filter' [-Wuninitialized]
                VarsExprsProductLattice(n, state,filter)
                                                 ^
rose/src/midend/programAnalysis/genericDataflow/simpleAnalyses/liveDeadVarAnalysis.C:1257:50: warning: base class 'VarsExprsProductLattice' is uninitialized when used here to access 'VarsExprsProductLattice::filter' [-Wuninitialized]
                VarsExprsProductLattice(n, state,filter)
                                                 ^

The following warning will not be fixed because it's reminding us to convert all this to std::thread if we decide to keep it:

make[4]: Entering directory '/tmp/build-dad/src/midend'
...
  CXX      astMatching/AstMatching.lo
rose/src/midend/astProcessing/AstSharedMemoryParallelSimpleProcessing.C:13:5: warning: "POSIX threads are unavailable on this platform" // blame initial commit [-W#warnings]
#   warning "POSIX threads are unavailable on this platform" // blame initial commit
    ^

The following flaw has been partly fixed. It is now a memory leak, but at least it's defined behavior. It will be merged soon.

make[6]: Entering directory '/tmp/build-dad/src/roseExtensions/roseHPCToolkit/src/xml2profir'
...
  CXX      query.lo
In file included from rose/src/roseExtensions/roseHPCToolkit/src/xml2profir/process.cc:24:
In file included from rose/src/roseExtensions/roseHPCToolkit/include/rosehpct/rosehpct.hh:38:
rose/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage/sage.hh:89:33: warning: address of stack memory associated with local variable 'result' returned [-Wreturn-stack-address]
      return const_cast<char *>(result.c_str());
                                ^~~~~~

@matzke1 matzke1 assigned tristanvdb and unassigned matzke1 Nov 16, 2022
pinnown pushed a commit that referenced this issue Aug 1, 2024
* The generated documentation didn't differentiate between
  parameterized nouns that need "an" versus "a" as their
  article. Since the value in question is definite, we can use "the"
  to avoid the incorrect grammar.

Issue #218+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants