Comments (3)
This seems to be fixed with the updated plan9 cpp (#26)
from lcc.
@ksherlock There's more, unfortunately. The following two don't produce correct output even with your pull request #26.
#define x 3
#define f(a) f(x * (a))
#undef x
#define x 2
#define g f
#define z z[0]
#define h g(~
#define m(a) a(w)
#define w 0,1
#define t(a) a
#define p() int
#define q(x) x
#define r(x,y) x ## y
#define str(x) # x
f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x+(3,4)-w) | h 5) & m
(f)^m(m);
p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };
char c[2][6] = { str(hello), str() };
/* expected: */
/*
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
int i[] = { 1, 23, 4, 5, };
char c[2][6] = { "hello", "" };
*/
#define t(x,y,z) x ## y ## z
int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,),
t(10,,), t(,11,), t(,,12), t(,,) };
/* expected: */
/*
int j[] = { 123, 45, 67, 89,
10, 11, 12, };
*/
is still broken.
from lcc.
@ksherlock I think abandoning this preprocessor, which lcc's authors didn't even write and may have problems debugging/fixing, and instead going for ucpp may be a far better solution. I just integrated it into my Smaller C compiler. Haven't yet seen a problem with ucpp. The sample code from the C standard preprocesses correctly with it.
from lcc.
Related Issues (20)
- assertion `bestreg` fails sometimes for some targets when there are too many locals HOT 2
- Compiling to Assembly not Linux HOT 10
- cpp buffer overflow on long lines HOT 1
- Please release the preprocessor under GPL as Plan9 where it originates from HOT 1
- mulops_calls option recognition
- Non-lvalue can be assigned after simplifying the shift operation
- Type rty definition should be at top HOT 2
- Add Support for macOS. HOT 1
- Are benchmarks comparing LCC with other compilers available ?
- Hello i would like to do language self programming and i would like to use this lcc compiler for you
- src/*.md files are copied incorrectly from repository HOT 2
- Question regarding origin of cpp - the C preprocessor HOT 3
- Targeting the CP1610 CPU for Intellivision possible? HOT 5
- macOS: Builtin issues HOT 1
- Assignment of struct compound-literal doesn't work. HOT 2
- how to run HOT 1
- Problem to build under linux
- AddressSanitizer: SEGV on unknown address
- Have a version of LCC retargetable to C99 HOT 2
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 lcc.