Git Product home page Git Product logo

Comments (6)

jserv avatar jserv commented on July 30, 2024 1

By commit changes on latest commit which discards changes that causes building failure?

There is no need to discard or revert existing commits such as 5979cb8. Simply ensure the _Bool support functions as intended by submitting new commits.

from shecc.

ChAoSUnItY avatar ChAoSUnItY commented on July 30, 2024

After applied a temporary hack for this certain circumstance:

diff --git a/src/lexer.c b/src/lexer.c
index f50ed97..db72b65 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -520,7 +520,17 @@ token_t lex_token_internal(bool aliasing)
             alias = find_alias(token_str);
             if (alias) {
                 /* TODO: Need more reliable way to identify the token's type */
-                token_t t = is_numeric(alias) ? T_numeric : T_identifier;
+                /* FIXME: comparison with string "bool" is a temporary hack */
+                token_t t;
+                
+                if (is_numeric(alias)) {
+                    t = T_numeric;
+                } else if (!strcmp(alias, "_Bool")) {
+                    t = T_identifier;
+                } else {
+                    t = T_string;
+                }
+                
                 strcpy(token_str, alias);
                 return t;
             }

This pops another issue:

  SHECC out/shecc-stage2.elf
Error Unexpected token at source location 18562
#define HOST_PTR_SIZE __SIZEOF_POINTER__
                      ^ Error occurs here
Abnormal program termination
make: *** [Makefile:85: out/shecc-stage2.elf] Error 255

I am uncertain if this issue is caused by current design or previous design flaw?

from shecc.

jserv avatar jserv commented on July 30, 2024
#define HOST_PTR_SIZE __SIZEOF_POINTER__
                      ^ Error occurs here
Abnormal program termination

I am uncertain if this issue is caused by current design or previous design flaw?

This effort by @vacantron last year was aimed at achieving self-hosting.

from shecc.

ChAoSUnItY avatar ChAoSUnItY commented on July 30, 2024

After investigate the diff from 5979cb8 and 7f328f3 by implementing functionalities step-by-step, I found that by replacing boolean related symbols, e.g. replacing int with bool, the stage-2 compilation would failed at #define HOST_PTR_SIZE __SIZEOF_POINTER__, which is unexpected consider nothing more than returning type and value is changed.

I will submit a hot fix by reverting previous PR #124 and implement back the necessary macro definitions.

from shecc.

jserv avatar jserv commented on July 30, 2024

I will submit a hot fix by reverting previous PR #124 and implement back the necessary macro definitions.

Can you rework the _Bool support instead?

from shecc.

ChAoSUnItY avatar ChAoSUnItY commented on July 30, 2024

I will submit a hot fix by reverting previous PR #124 and implement back the necessary macro definitions.

Can you rework the _Bool support instead?

By commit changes on latest commit which discards changes that causes building failure?

from shecc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.