#Making implicit ints 64 bits

8 messages · Page 1 of 1 (latest)

copper egret
#

Is it possible to make either clang or gcc use 64 bits for ints (especially for implicit ints)?

Context: I'm trying to compile some ancient 1994 C code for fun. There's a lot of implicit function declarations all over the place, passing pointers around and whatnot. The problem is that these implicit functions expect 32 bit integers for their arguments, which means that the pointers get mangled when passed. I can fix this by making a __fixes.h header file and predeclaring all the relevant functions in there, but that's a huge effort. It'd be much easier if i could just change what int is.

bronze coyoteBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

worn dune
#

#define int int64_t???

copper egret
#

here's an example of the issue:

#

;compile -w ```c
#include <stdio.h>
add1(x) { ++*(int *)x; }

main() {
int x = 12;
add1(&x);
printf("%d\n", x);
}

fiery solsticeBOT
#
Compilation successful

No output.

bronze coyoteBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.