Skip to content

case_limit #5

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

Closed
joerg-d opened this issue Apr 24, 2014 · 9 comments
Closed

case_limit #5

joerg-d opened this issue Apr 24, 2014 · 9 comments

Comments

@joerg-d
Copy link

joerg-d commented Apr 24, 2014

For some of my projects I need a higher case_limit (e.g. 256). Is there any reason to set this to 64?

@reltham
Copy link
Collaborator

reltham commented May 29, 2014

It is limited to 64, because that is what the original Spin compiler is limited to.

@konimaru
Copy link

It may be useful in the long run to introduce an option which explicitly removes certain limits.

reltham added a commit that referenced this issue Mar 16, 2015
Added a new Unused Method Removal option (-u). This option still needs testing, use with caution. (Issue #9)
Increased the pubcon list buffer size to 32K. (issue #14)
Fixed a crash bug in the preprocessor. (issue #16)
Renamed a few .c files to .cpp.
The solution & project files are now VS2013 format. You can get VS2013 community edition free.
reltham added a commit that referenced this issue Mar 16, 2015
reltham added a commit that referenced this issue Mar 16, 2015
Increased case_limit to 256. (issue #5)
Added a new Unused Method Removal option (-u). This option still needs
testing, use with caution. (Issue #9)
Increased the pubcon list buffer size to 32K. (issue #14)
Fixed a crash bug in the preprocessor. (issue #16)
Renamed a few .c files to .cpp.
The solution & project files are now VS2013 format. You can get VS2013
community edition free.
@reltham reltham closed this as completed Mar 16, 2015
@konimaru
Copy link

So this means the case limit still applies (64)? Just seemed odd that the limit was increased and then removed again (according to the log messages).

@reltham
Copy link
Collaborator

reltham commented Mar 16, 2015

No, I had submitted a partial set of files, reverted that, and then submitted the full set of files. The partial set of files didn't have a summary description while the full set did, this may have caused your confusion? Just click the ... buttons to see the full description of the submits to see that the 3rd one also has the case_limit change to 256 in it.

@konimaru
Copy link

OK. It's Monday morning here before my first coffee. I'll check later. Thanks.

@konimaru
Copy link

Can you do something about the build errors (simple make invocation)?

g++ -Wall -g -static -o UnusedMethodUtils.o -c UnusedMethodUtils.cpp
UnusedMethodUtils.cpp: In function ‘int ScanLowerOpcode(unsigned char*, MethodUsage*, ObjectEntry*, unsigned char*)’:
UnusedMethodUtils.cpp:554:139: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision [-fpermissive]
                 pUsage->pCalls[pUsage->nCurrCall].objaddress = (unsigned int)&pObject->pObject[pUsage->pCalls[pUsage->nCurrCall].objoffset];
                                                                                                                                           ^
UnusedMethodUtils.cpp:563:95: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision [-fpermissive]
                 pUsage->pCalls[pUsage->nCurrCall].objaddress = (unsigned int)(pObject->pObject);
                                                                                               ^
UnusedMethodUtils.cpp: In function ‘void MarkCalls(MethodUsage*, ObjectEntry*)’:
UnusedMethodUtils.cpp:822:87: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 ObjectEntry* pSubObject = GetObject((unsigned char*)(pCall->objaddress));
                                                                                       ^
make[1]: *** [UnusedMethodUtils.o] Error 1
g++ (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@reltham
Copy link
Collaborator

reltham commented Mar 16, 2015

It compiles fine under gcc 4.6.2. Since when did they change it so that explicitly casting doesn't get rid of the "loses precision" thing? And when did that become an error instead of a warning?

@reltham
Copy link
Collaborator

reltham commented Mar 16, 2015

I submitted a fixup for you that should work. I don't have gcc 4.8.3 available right now to test on, so if there were other problems besides what you listed then it'll have to wait. It's annoying how they keep changing what is a warning or error and that even with an explicit cast they now don't shut up about lost precision and call it an error.

@drawkula
Copy link

Compiles on Debian8 (gcc version 4.9.2).

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

4 participants