Article View: comp.sys.hp.hpux
Article #36struct init problem
From: The Devil Himself
Date: Mon, 04 Mar 1996 18:37
Date: Mon, 04 Mar 1996 18:37
58 lines
1663 bytes
1663 bytes
I found that the attached code does not compile on HP's, but does compile on
UNIXware, etc. I'd like to hear any ideas beside my hacked solution.
I'm looking for a way to preserve using the struct = { .... } syntax.
Also, who you characterize this problem vs. ansi C.....
E-mail answers please....
Thanks - D
_+_+_+_+_+_+_ problem code _+_+_+_+
struct testme
{
int dum_huh ;
int * p ;
} ;
void foofunk( void )
{
int ima_int = 0xdeadbeef ;
{
struct test_me please =
{
0xbeefdead ,
& ima_int
} ;
/*
* NOTE: HP-UX foo A.09.05 A 9000/712
* wont compile this & ima_int statement, unless I declare
* BOTH ima_int AND please as "static". unfortunately, I want this
* code to be reenterant.
*/
}
/* whatever */
}
_+_+_+_+_+_+ hack solution _+_+_+_+_+
void foofunk( void )
{
int ima_int = 0xdeadbeef ;
{
struct test_me please =
{
0xbeefdead ,
} ;
please . p = & ima_int
/* whatever */
}
/* whatever */
}
--
.... (C) 1995 Copyright Duncan Idaho, All Rights Reserved ..................
There are "three absolute rights [sic] the right of personal security, personal
liberty and personal property," Sir William Blackstone. "The protection of
these faculties is the first object of government." Madison, Federalist 10.
Technical Details
Message-ID:
<DnrAEx.HA@tpoint.net>Path:
arc1-ca.pugleaf.net!news.sprintlink.net!news!devilShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.hp.hpux,comp.std.c,comp.lang.c Path: arc1-ca.pugleaf.net!news.sprintlink.net!news!devil From: devil@tpoint.net (The Devil Himself) Subject: struct init problem Message-ID: <DnrAEx.HA@tpoint.net> Followup-To: poster Reply-To: devil@tpoint.net Organization: Not Hardly! Distribution: na Date: Mon, 4 Mar 1996 18:37:45 GMT