- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- C - Compilation Warning..
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2002 12:07 AM
05-02-2002 12:07 AM
C - Compilation Warning..
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2002 12:58 AM
05-02-2002 12:58 AM
Re: C - Compilation Warning..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2002 02:04 AM
05-02-2002 02:04 AM
Re: C - Compilation Warning..
its
----------
city_null_def_ptr=(def *)city_null_def_ptr->next;
------------
thanks for ur response.
william
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2002 02:22 AM
05-02-2002 02:22 AM
Re: C - Compilation Warning..
This typecasts (city_null_def_ptr->next) to (def *)
Can you check the datatype of city_null_def_ptr->next? Investigate if it would be possible to change this to (def *) in the structure itself.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2002 11:49 AM
05-09-2002 11:49 AM
Re: C - Compilation Warning..
We're doing a migration from 10.2 to 11.0 and are encountering the same message (among others) in our compilations. To supplement what Messrs. Basoi and Extross have already said:
There's a file called /opt/ansic/lib/nls/msg/C/cc.msgs that has supposedly has all the error or warning messages the cc compiler can generate. The one you're getting has the following comments:
----------------------------------------------
Warning 530
===========
Casting from loose to strict alignment: Resulting pointer may be misaligned.
Your program casts a pointer variable whose type is of looser alignment to a
pointer to a type of stricter alignment. The size of the type of the object of
looser alignment is smaller than the size of the type of stricter alignment.
For example,
char * cp1, *cp2;
double * dp;
cp1 = (char *)dp; /* strict to loose
conversion is OK */
dp = (double *)cp2; /* loose to strict conversion;
might cause alignment
problems. */
Using this construct is prone to run-time problems (such as "Bus error")
because of the alignment of the pointer's type not matching the alignment of
the pointer's value. Such conversions should not be used.
ANSI 3.3.4
----------------------------------------------
There is also documentation of some (but not all) of these messages, in addition to some from the C++ compiler, available online at http://docs.hp.com/hpux/onlinedocs/dev/C/B3901BA/errors.html#CWMSGS. And you can look up the ANSI reference, with the rationale behind it, at http://www.lysator.liu.se/c/rat/title.html.
As the comments imply, this warning calls attention to what can theoretically be a serious problem. On the other hand, we got this warning on 10.2 with code that has been running successfully for years. Still, on the assumption that the 64-bit architecture may be fussier than 32-bit on alignment matters, I used the approach Mr. Extross describes to rewrite the code in such a way as to eliminate the messages. If you just want to keep the messages from appearing, you can use Sr. Bassoi's approach or add +W 530 (suppress warning message #530) to your cc flags. (Or if you want the compiler to promote the warning to error level and so terminate the compilation, you can use +We 530).
This may be a lot more information than you wanted, but it may eliminate the need to go to the Forum in order to deal with other messages you might encounter porting your code to the new machines.
Best regards,
Rich