1834499 Members
2659 Online
110068 Solutions
New Discussion

C - Compilation Warning.

 
william_39
Occasional Advisor

C - Compilation Warning.

Dear all,
while porting 32 bit proC code on 64 bit HP machine it gives following warnings.

--------------
cc: "cach.c", line 2803: warning 530: LP64 migration: Casting from loose to strict alignment: Resulting pointer may be misaligned.

-------------------

is this major warning ?? will it affect in runtime ?
is there in way to remove this warnings ..?

Thanks in advance,

William
1 REPLY 1
Ricardo Bassoi
Regular Advisor

Re: C - Compilation Warning.


The CC always tries to compile your program if possible; it never gratuitously rejects a program whose meaning is clear merely because (for instance) it fails to conform to a standard. In some cases, however, the C and C++ standards specify that certain extensions are forbidden, and a diagnostic must be issued by a conforming compiler.
The `-pedantic' option tells CC to issue warnings in such cases; `-pedantic-errors' says to make them errors instead. This does not mean that all non-ANSI constructs get warnings or errors.

In your case try to run:

cc -o cach -assume noaligned_objects cach.c

Regards,
Bassoi
If you never try, never will work