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

Code that compiles fine fail with '#feature on safety' #203

Open
mingodad opened this issue Jun 2, 2024 · 1 comment
Open

Code that compiles fine fail with '#feature on safety' #203

mingodad opened this issue Jun 2, 2024 · 1 comment

Comments

@mingodad
Copy link

mingodad commented Jun 2, 2024

While testing the latest build-204 and the #feature on safety on an amalgamation of https://github.com/mingodad/squilu I can get it to build/execute fine when #feature on safety is not defined otherwise I'm getting some errors that doesn't seem related to the safety checks (see attached all code needed to reproduce the problem):

mk-squilu-circle.sh
error: am-squilu.cpp:1124:15
        resize(old_size + count); 
              ^
no viable candidates in call to resize
  object is lvalue SQCharBuf
  argument 0 is prvalue unsigned long long
  candidate: am-squilu.cpp:1037:8
    void resize(SQSizeType newsize, const T& fill = T()) 
         ^
    error: am-squilu.cpp:1124:15
            resize(old_size + count); 
                  ^
    could not bind implicit object parameter sqvector<char>& to lvalue SQCharBuf

error: am-squilu.cpp:1351:10
    _type=OT_NULL; 
         ^
left operand prvalue const tagSQObjectType& in assignment must be lvalue

error: am-squilu.cpp:1357:7
      _constructWith(o); 
      ^
use -> to access members through lvalue const SQObjectPtr&

error: am-squilu.cpp:1357:7
      _constructWith(o); 
      ^
use -> to access members through lvalue const SQObjectPtr&

error: am-squilu.cpp:1361:7
      _constructWith(o); 
      ^
use -> to access members through lvalue const tagSQObject&

error: am-squilu.cpp:1361:7
      _constructWith(o); 
      ^
use -> to access members through lvalue const tagSQObject&

error: am-squilu.cpp:1364:3
  _REF_TYPE_DECL(OT_TABLE,SQTable,Table) 
  ^
left operand prvalue const tagSQObjectType& in assignment must be lvalue

error: am-squilu.cpp:1364:3
  _REF_TYPE_DECL(OT_TABLE,SQTable,Table) 
  ^
cannot narrow int to bool

error: am-squilu.cpp:1364:3
  _REF_TYPE_DECL(OT_TABLE,SQTable,Table) 
  ^
left operand prvalue const tagSQObjectType& in assignment must be lvalue

error: am-squilu.cpp:1364:3
  _REF_TYPE_DECL(OT_TABLE,SQTable,Table) 
  ^
no viable candidates in call to Release
  object is lvalue SQRefCounted
  candidate: am-squilu.cpp:1220:3
    ABSTRACT_METHOD(virtual void Release(), {}) 
    ^
    error: am-squilu.cpp:1364:3
      _REF_TYPE_DECL(OT_TABLE,SQTable,Table) 
      ^
    could not bind implicit object parameter SQRefCounted& to lvalue SQRefCounted

error: am-squilu.cpp:1364:3
  _REF_TYPE_DECL(OT_TABLE,SQTable,Table) 
  ^
cannot convert lvalue SQObjectPtr to SQObjectPtr&
SQObjectPtr declared at am-squilu.cpp:1346:1

error: translation aborted; too many errors

mk-squilu-circle.sh:

optim=-O2
#CXX=g++
#CXX="clang-18-env clang++"
CXX="circle -DCIRCLE_SAFETY_ON"
#CXX=circle

$CXX $optim  -fno-rtti -Wall \
	-DNDEBUG -DONLY_ASCII -DNO_ABSTRACT_METHOD -DCUSTOM_DELETE_OPERATOR -DSQ_USE_MKSTEMP  -DSQ_ENABLE_INCLUDES -DSQ_SUBLATIN -DNEED_SUBLATIN_C -DSQUSEDOUBLE \
	-D__SQAMALGAMATION__ -D_SQ64 -DMAKE_SQ_CMD am-squilu.cpp -o am-squilu-circle
@mingodad
Copy link
Author

mingodad commented Jun 2, 2024

Here is all code needed to reproduce the issue.
am-squilu.cpp.zip

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

1 participant