Whenever I try to use __sync_fetch_and_add with -m32 on a 64 bit machine, I get the following error, while it compiles fine with normal 64 bit. I am using gcc compiler 4.1.2. What can be the problem here and what is the solution? Answer Using -march=i486 flag did the trick for me.
Tag: 32bit-64bit
Getting IP address from struct sockaddr doesn’t work for 32bit compilation
I have a small client/server app that sends/receives UDP discovery packets. When a UDP packet is received I want to display the source IP. The client/server code is based on the UDP example from Beej: https://beej.us/guide/bgnet/html/multi/clientserver.html When I compile for 64bit the IP is displayed as expected but when I compile for 32bit (-m32 option) it doesn’t get the right