Comments (6)
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.
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.
#define HOST_PTR_SIZE __SIZEOF_POINTER__ ^ Error occurs here Abnormal program terminationI 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.
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.
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.
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)
- Integrate with semu HOT 5
- Parse syntax for include macro in parser.c HOT 5
- Uninitialized variable: pred HOT 2
- The peephole optimization breaks the macro expansion HOT 2
- Declare variables where needed
- Fail to self-host HOT 1
- Support macros defined in <stdbool.h> HOT 5
- Unable to self compile stage 1 HOT 1
- For a coding question: about parser HOT 3
- Enhance the implementation of division emulation in the Arm backend
- Support conversion specifier ā%cā inside printf HOT 1
- Support mmap on shecc HOT 2
- Improve intermediate representation and also register allocation
- Handle non-zero integers in if statements HOT 1
- Thoughts on cfront's potential improvements HOT 11
- Determine the factors contributing to unexpected slowdowns during self-hosting HOT 2
- Eliminate compilation warnings
- Implement basic optimizations HOT 3
- High branch-miss rate when hosting shecc on the Raspberry Pi 3B
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shecc.