Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* BUG of Tru64UNIX V5.1
@ 2001-08-23  2:27 Ginny E. Kim
  2001-08-23 15:50 ` Joe Mario
  0 siblings, 1 reply; 3+ messages in thread
From: Ginny E. Kim @ 2001-08-23  2:27 UTC (permalink / raw)


I got following message while comiling my module with defined
"_KERNEL".

cc: Error: /sys/include/machine/pcb.h, line 179: In the declaration of
"x", the array bound "((int)(&((struct stack_layout
...)(0))->pcb)&127)?-1:1" is not a positive integer. (notposint)
struct _pcb_align_check { char x[((int)stack_to_pcb(0) & 127) ? -1 :
1]; };
-------------------------------^

The header file , /sys/include/machine/pcb.h has following contents..

#define stack_to_pcb(stack) (&((struct stack_layout *)(stack))->pcb)
#define pcb_to_stack(pcb)
((vm_offset_t)(((long)(pcb))&~(KERNEL_STACK_SIZE-1)))
struct _pcb_size_check { char x[(sizeof(struct pcb) == 0x300) ? 1 :
-1]; };
struct _pcb_align_check { char x[((int)stack_to_pcb(0) & 127) ? -1 :
1]; };

Isn't it a OS bug that"((int)(&((struct stack_layout
...)(0))->pcb)&127)?-1:1" can't be positive interger?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: BUG of Tru64UNIX V5.1
  2001-08-23  2:27 BUG of Tru64UNIX V5.1 Ginny E. Kim
@ 2001-08-23 15:50 ` Joe Mario
  2001-08-24  5:42   ` Ginny E. Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Mario @ 2001-08-23 15:50 UTC (permalink / raw)


> Isn't it a OS bug that"((int)(&((struct stack_layout
> ...)(0))->pcb)&127)?-1:1" can't be positive interger?

Ginny:
	This is a poor-man's way to ensure that the pcb member of
   	the stack_layout structure is properly aligned.  In your
	compilation, the pcb member was not aligned properly so
	the the size of the _pcb_align_check array was -1, which
 	intentionally results in a compile-time error.  
	(Note that since this was added, the compiler has added 
	pragmas to support this kind of compile-time checking.)

	It looks like you are either building your module wrong or
	you've modified something that caused the size/layout of
	the stack_layout struct to change.
Joe

"Ginny E. Kim" wrote:
> 
> I got following message while comiling my module with defined
> "_KERNEL".
> 
> cc: Error: /sys/include/machine/pcb.h, line 179: In the declaration of
> "x", the array bound "((int)(&((struct stack_layout
> ...)(0))->pcb)&127)?-1:1" is not a positive integer. (notposint)
> struct _pcb_align_check { char x[((int)stack_to_pcb(0) & 127) ? -1 :
> 1]; };
> -------------------------------^
> 
> The header file , /sys/include/machine/pcb.h has following contents..
> 
> #define stack_to_pcb(stack) (&((struct stack_layout *)(stack))->pcb)
> #define pcb_to_stack(pcb)
> ((vm_offset_t)(((long)(pcb))&~(KERNEL_STACK_SIZE-1)))
> struct _pcb_size_check { char x[(sizeof(struct pcb) == 0x300) ? 1 :
> -1]; };
> struct _pcb_align_check { char x[((int)stack_to_pcb(0) & 127) ? -1 :
> 1]; };
> 
> Isn't it a OS bug that"((int)(&((struct stack_layout
> ...)(0))->pcb)&127)?-1:1" can't be positive interger?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: BUG of Tru64UNIX V5.1
  2001-08-23 15:50 ` Joe Mario
@ 2001-08-24  5:42   ` Ginny E. Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Ginny E. Kim @ 2001-08-24  5:42 UTC (permalink / raw)


Joe Mario <mario@zk3.dec.com> wrote in message news:<3B852645.D92BD669@zk3.dec.com>...
> > Isn't it a OS bug that"((int)(&((struct stack_layout
> > ...)(0))->pcb)&127)?-1:1" can't be positive interger?
> 
> Ginny:
> 	This is a poor-man's way to ensure that the pcb member of
>    	the stack_layout structure is properly aligned.  In your
> 	compilation, the pcb member was not aligned properly so
> 	the the size of the _pcb_align_check array was -1, which
>  	intentionally results in a compile-time error.  
> 	(Note that since this was added, the compiler has added 
> 	pragmas to support this kind of compile-time checking.)
> 
> 	It looks like you are either building your module wrong or
> 	you've modified something that caused the size/layout of
> 	the stack_layout struct to change.
> Joe
> 

My program doesn't have something that cased the size/layout of the
stack_layout struct to change.
It just includes <sys/mbuf.h>. <sys/mbuf.h> includes <machine/pcb.h>
in several stages...
Is it needed other includeing header file?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-08-24  5:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-23  2:27 BUG of Tru64UNIX V5.1 Ginny E. Kim
2001-08-23 15:50 ` Joe Mario
2001-08-24  5:42   ` Ginny E. Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox