4 ms·
I don't understand what "migrate this code into the year 2022" means. What's the actual problem you're trying to solve? If: wget, unzip, untar, ./configure
by ryandrake 5y ago
I don't understand what "migrate this code into the year 2022" means. What's the actual problem you're trying to solve? If:
wget, unzip, untar, ./configure, make, su make install and it works perfectly
Then, you're done, right? Why do you need to make any changes? If it doesn't like -std=c99, and it works without it, just don't compile it with -std=c99.
Are you trying to port it to some other host or architecture? If so, you'll need to learn C to port it.
Are you trying to port it to a 64-bit target or something like that? If so, you'll need to learn some C.
Does the existing code compile and run but has show-stopper bugs for you? If so, you'll need to learn C and fix them.
- yakubin 5y agoPoster wrote that it works when compiled on Debian 3, but not on Debian 11. Support for Debian 3 ended on 31 March 2008. Most recent Debian release is Debian 11. Probably the most important things that changed are GCC and glibc.
- switchbak 5y agoLooks like 64 bit support is his main goal. Sounds like lots of pointer arithmetic in there that doesn't port well. Agree that they'll definitely have to learn C. Sounds like this will definitely teach them some of that!
- fhars 5y agoNo, the original code supports Alpha, so it should be 64bit clean. It's got loads of other issues, though. Not respecting sequence points seems to be the most obvious.
- sargstuff 5y agoAl, yeah, but does Alpha handle addresses boundaries on 1,2,3,4 byte boundaries. If its, more than one, it might compile, but will not run. https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attribut...
- sargstuff 5y agoSome implicit hardware references implied by use of C casts. C compiler doesn't guarantee bit spacing/alignment in strucs. (*char) is used to force pointer address inside of a struct to align on byte boundary which is not true of all hardware! aka adresses allignment may need to be 16, 32, or 64.
- fhars 5y agoYou cut the operative "... under Debian 3" from your quote. The current Debian is Debian 11, that is eight major releases later, and Debian is not exactly famous for its blazingly fast release schedule. (For context: When Debian 3 was released, the current browser versions were Netscape 6.2.3 and Internet Explorer 6.0) See also https://www.debian.org/News/2002/20020719 https://www.debian.org/News/2002/20020719
- ryandrake 5y agoHe also said, "Taking the executable from Debian 3 to Debian 11 (32 bit) and it works perfectly." Maybe I'm the only one, but I still think the problem statement is totally missing. A simple "I'm trying to get it to compile using gcc [version x], glibc [version y] on Debian [version z]." would have clarified the end goal.