Re: Trying to use gdb on OS X
- Posted by jimcbrown (admin) Jun 09, 2013
- 3322 views
long long is in C99; isn't it reasonable to expect it to be present? We compile on gcc 99% of the time on all platforms so we can almost assume it. I don't mind changing it to int64_t, though, but if so then we may want to follow suit throughout the whole source.
Hmm, that's a good point. I guess one day in the far future, there might be a platform that gcc supports with 256 sized ints where long long isn't 64bits ... but that's probably not worrying about right now.
but if so then we may want to follow suit throughout the whole source.
I felt that we should do this anyways, considering that only int64_t et al guarantee a particular size in bits. This is a huge job though.
As far as performance is concerned, I thought about that but I thought that wrapping more decisions around the casts would probably be worse in the long run than just performing the casts only when necessary.
Well, #ifdefs take no runtime performance hit at all. Just saying.
Most of them are performed by hardware anyway. It would probably have to be measured for sure. I doubt the cast to long long takes much longer than the cast to unsigned long, however. I didn't really add any new casting. Regardless, compiler optimizations should count for that too.
Thinking it over, you're probably right. It's not like hardware is getting any slower, anyways.
As for submitting my changes, I would like them reviewed and tested by others before actually committing them into the mainline 4.0 branch. I especially want to make sure they run on other platforms as I expect them to. Should I just commit to 4.0, or should I make a new tag or branch, or what? I'll post diffs to the forum if I need to.
A new branch is probably best... I don't think it's a big deal if you commit straight to 4.0 though. Someone needs to test on ARM and the other platforms to make sure nothing breaks anyways...
Edit: Oh, I think that OpenWatcom 1.2 supports long long. http://www.openwatcom.org/index.php/C99_Compliance
Hmm. Maybe I was thinking of MSVC...