CObjectSystem / COS

C Object System: a framework that brings C to the level of other high level programming languages and beyond

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warning: pointer '_1' may be used after 'cos_free' [-Wuse-after-free]

opened this issue · comments

*** Compiling [debug] Any.c
In file included from include/cos/cos/cos.h:65,
                 from include/cos/Object.h:28,
                 from src/Any.c:20:
src/Any.c: In function 'cos_f_gdealloc__Any':
include/cos/cos/contract.h:219:18: warning: pointer '_1' may be used after 'cos_free' [-Wuse-after-free]
  219 |       COS_PP_CAT(cos_contract_invariant,C)(COS_PP_SEQ(COS_SEL_NAME(C)), \
      |                  ^
include/cos/cpp/utils.h:69:33: note: in definition of macro 'COS_PP_CAT_'
   69 | #define COS_PP_CAT_(a,...)      a##__VA_ARGS__
      |                                 ^
include/cos/cos/contract.h:219:7: note: in expansion of macro 'COS_PP_CAT'
  219 |       COS_PP_CAT(cos_contract_invariant,C)(COS_PP_SEQ(COS_SEL_NAME(C)), \
      |       ^~~~~~~~~~
include/cos/cos/method.h:296:3: note: in expansion of macro 'COS_CTR_INVARIANT'
  296 |   COS_CTR_INVARIANT(C) \
      |   ^~~~~~~~~~~~~~~~~
include/cos/cos/method.h:154:1: note: in expansion of macro 'COS_MTH_FUNCDEF'
  154 | COS_MTH_FUNCDEF(RET,NAME,TAG,PS,CS,AS,C,A,R,T) \
      | ^~~~~~~~~~~~~~~
include/cos/cos/method.h:143:9: note: in expansion of macro 'COS_MTH_DEF_1'
  143 |         COS_MTH_DEF_1(RET,NAME,TAG,PS,CS,AS, \
      |         ^~~~~~~~~~~~~
include/cos/cos/method.h:135:9: note: in expansion of macro 'COS_MTH_DEF_0'
  135 |         COS_MTH_DEF_0(RET, \
      |         ^~~~~~~~~~~~~
include/cos/cos/method.h:87:24: note: in expansion of macro 'COS_MTH_DEF'
   87 | #define defmethod(...) COS_MTH_DEF(__VA_ARGS__)
      |                        ^~~~~~~~~~~
src/Any.c:74:1: note: in expansion of macro 'defmethod'
   74 | defmethod(void, gdealloc, Any)
      | ^~~~~~~~~
src/Any.c:75:3: note: call to 'cos_free' here
   75 |   cos_free(_1);
      |   ^~~~~~~~~~~~