Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Issues
  • #386

Closed
Open
Created Nov 12, 2019 by frey_m@frey_mMaintainer

compiler warnings due to memcpy

With gcc/8.3.0 and later we get compiler warnings due to memcpy in IPPL.

/users/freym/git/opal/src/ippl/src/Index/IndexInlines.h:359:1:   required from here
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:378:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of non-trivially copyable type 'struct PETE_TBTree<FnMax, Index::cursor, PETE_Scalar<double> >'; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(this,&t,sizeof(*this));
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:343:8: note: 'struct PETE_TBTree<FnMax, Index::cursor, PETE_Scalar<double> >' declared here
 struct PETE_TBTree :
        ^~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h: In instantiation of 'PETE_TBTree<Value_t, Left_t, Right_t>::PETE_TBTree(const PETE_TBTree<Value_t, Left_t, Right_t>&) [with Value_t = FnMax; Left_t = PETE_Scalar<double>; Right_t = Index::cursor]':
/users/freym/git/opal/src/ippl/src/Index/IndexInlines.h:359:1:   required from here
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:378:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of non-trivially copyable type 'struct PETE_TBTree<FnMax, PETE_Scalar<double>, Index::cursor>'; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(this,&t,sizeof(*this));
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:343:8: note: 'struct PETE_TBTree<FnMax, PETE_Scalar<double>, Index::cursor>' declared here
 struct PETE_TBTree :
        ^~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h: In instantiation of 'PETE_TBTree<Value_t, Left_t, Right_t>::PETE_TBTree(const PETE_TBTree<Value_t, Left_t, Right_t>&) [with Value_t = FnMin; Left_t = Index::cursor; Right_t = PETE_Scalar<double>]':
/users/freym/git/opal/src/ippl/src/Index/IndexInlines.h:360:1:   required from here
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:378:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of non-trivially copyable type 'struct PETE_TBTree<FnMin, Index::cursor, PETE_Scalar<double> >'; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(this,&t,sizeof(*this));
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:343:8: note: 'struct PETE_TBTree<FnMin, Index::cursor, PETE_Scalar<double> >' declared here
 struct PETE_TBTree :
        ^~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h: In instantiation of 'PETE_TBTree<Value_t, Left_t, Right_t>::PETE_TBTree(const PETE_TBTree<Value_t, Left_t, Right_t>&) [with Value_t = FnMin; Left_t = PETE_Scalar<double>; Right_t = Index::cursor]':
/users/freym/git/opal/src/ippl/src/Index/IndexInlines.h:360:1:   required from here
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:378:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of non-trivially copyable type 'struct PETE_TBTree<FnMin, PETE_Scalar<double>, Index::cursor>'; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(this,&t,sizeof(*this));
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:343:8: note: 'struct PETE_TBTree<FnMin, PETE_Scalar<double>, Index::cursor>' declared here
 struct PETE_TBTree :
        ^~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h: In instantiation of 'PETE_TBTree<Value_t, Left_t, Right_t>::PETE_TBTree(const PETE_TBTree<Value_t, Left_t, Right_t>&) [with Value_t = OpAdd; Left_t = Index::cursor; Right_t = PETE_Scalar<float>]':
/users/freym/git/opal/src/ippl/src/Index/IndexInlines.h:388:1:   required from here
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:378:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of non-trivially copyable type 'struct PETE_TBTree<OpAdd, Index::cursor, PETE_Scalar<float> >'; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(this,&t,sizeof(*this));
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:343:8: note: 'struct PETE_TBTree<OpAdd, Index::cursor, PETE_Scalar<float> >' declared here
 struct PETE_TBTree :
        ^~~~~~~~~~~
/users/freym/git/opal/src/ippl/src/PETE/PETE.h: In instantiation of 'PETE_TBTree<Value_t, Left_t, Right_t>::PETE_TBTree(const PETE_TBTree<Value_t, Left_t, Right_t>&) [with Value_t = OpAdd; Left_t = PETE_Scalar<float>; Right_t = Index::cursor]':
/users/freym/git/opal/src/ippl/src/Index/IndexInlines.h:388:1:   required from here
/users/freym/git/opal/src/ippl/src/PETE/PETE.h:378:11: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of non-trivially copyable type 'struct PETE_TBTree<OpAdd, PETE_Scalar<float>, Index::cursor>'; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(this,&t,sizeof(*this));
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking