Comments (3)
Hi lionfaith!
well the argument of & is supposed to work on lvalues - and usually an
lvalue is taken as something that can be assigned to (e.g. it is the
left side of an assignment statement). Other compilers such as the
microsoft compiler, the borland compiler, and the watcom compiler all
seem to stick to that definition; gcc is the only one I can find that
has this other behavior.
However, that said, the GCC implementation doesn't seem to be out of
bounds, because the latest spec actually defines an lvalue as something
that can refer to an object, and I can see a case being made that the
specific examples you have quoted do indeed refer to objects. So I
will look into implementing it :)
David
lionfaith wrote:
Hello!
I'm trying to compile on windows some SDL based free software project
which AFAIK compiles on Linux (supposedly with gcc) and I envetually
step upon errors on this kind of expressions:
&--theEnemy->thinktime
&(theEnemy->dx -= 0.5)
&(++enemy[WC_BOSS].shield)
&(--engine.eventTimer)
&(star[i].x += (engine.ssx * star[i].speed))
And many others all alike. Although it is used in some kind
optimisation hack, it seems to be valid code. The address-of operator
is not limited to variable, but can be applied on any leftvalue. Or so
it seems.As '&' operator is hard to search for on the internet, the only clear
reference to this behavior I could find is this:
https://msdn.microsoft.com/en-us/library/64sa8b1e.aspx—
Reply to this email directly or view it on GitHub
#10.
from orangec.
hi lionfaith,
I released a new version which will allow the compiler to take the address of objects that are returned from an assignment, a preincrement, or a postincrement. Please let me know whether this is sufficient or if there are other types of expressions gcc lets get by as well.
David
from orangec.
Hi! Great thanks! So fast!
I've downloaded 5.25 and the faulty files now compiles without complains.
from orangec.
Related Issues (20)
- FR: please add the tools' purpose to their help output
- Remove Coff2IEEE HOT 1
- `occ -M` doesn't print anything to stdio
- Orange C failed to compile this project HOT 2
- IDE program not properly installed in new install of v67.3.1 on Windows 10 as current user HOT 3
- Incorrect conversion of double precision constants to IEEE-754 format HOT 5
- Segfault during Lua compilation HOT 1
- Does Orange C support `__declspec(thread)` or `__thread`?
- Update OCCIL to work with .NET Core? HOT 7
- Enhancement: A tool to convert normal C to the OCCIL dialect HOT 3
- Question: Is it possible to use native DLL with OCCIL? HOT 2
- OCL readme - cl386 leftovers? HOT 1
- Error: Undefined External 'WinMain' in module c0pe.nas HOT 4
- OCCIL: Fatal error: could not load lsmsilcrtl.dll HOT 3
- fix the 'read the docs' page HOT 1
- Make it possible to link DLL directly HOT 1
- Please update the CHM help files
- The layout on `read the docs` page is broken HOT 1
- The links on `read the docs` page is broken HOT 3
- Moving away from `read the docs` HOT 1
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 orangec.