Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22159

Interrogate the C compiler about data types when cross-compiling

$
0
0

I am working on a cross-platform project that uses GNU Autotools for the build system, and I was wondering if there is a way to run a simple sizeof(int) and pass the result to the configure script (or even simply to the standard output) when cross-compiling.

Let's imagine I am using a 32-bit machine for compiling a program for a 64-bit machine. If my compiler is able to compile code for a different architecture it means that surely knows the result of sizeof(int)on the target architecture.

My question is: How do I interrogate the compiler for obtaining that information when cross-compiling?


Viewing all articles
Browse latest Browse all 22159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>