Skip to content
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

Code should be updated to ANSI C #3

Open
michaelcmartin opened this issue Jan 23, 2016 · 4 comments
Open

Code should be updated to ANSI C #3

michaelcmartin opened this issue Jan 23, 2016 · 4 comments

Comments

@michaelcmartin
Copy link
Contributor

This has several subtasks:

  • Function prototypes for everything that is used in other files (GCC support required some of this but not for everything)
  • Match up functions to include files as ultimately standardized
  • Many functions that take format strings should really be varargs functions that forward to vprintf
  • Remove calls to deprecated functions like mktmp and use the preferred functions instead
  • There are some extremely dire errors involving objects being missized at link time by hundreds of bytes. We should look into that
  • Ideally, in doing this we could make the code 64-bit clean. That's a task of unknown size at present and might be better tracked as a separate issue.
@pdewacht
Copy link
Contributor

The link-time errors about missized objects can be solved by adding the extern keyword to the array declarations in macrossGlobals.h.

@pdewacht
Copy link
Contributor

In my fork (http://github.com/pdewacht/macross) I have sort of a rough start to this. I used GCC's protoize tool to add function prototypes, fixed the thus-discovered errors (though not the warnings), and converted the vararg-like functions to actual varargs.

I'm not submitting this as a pull request, as the work is pretty rough, and I don't think I'm going to spend further time on this. Still, it's a useful start for somebody who's willing to put serious effort in this.

@michaelcmartin
Copy link
Contributor Author

I'm looking through the results, and it's very promising so far. The vast majority of the remaining warnings are int-conversion and incompatible-pointer-type warnings. It's good that those have stuck around - I think those actually will explicitly mark the places where the code is not 64-bit clean.

@michaelcmartin
Copy link
Contributor Author

I've started exploiting the results from gcc aux-info (which protoize uses under the hood) and this is coming along pretty nicely. It's developing at https://github.com/michaelcmartin/macross/tree/ansi-c so far, and I've got Macross largely in shape and Slinky should follow shortly.

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

2 participants