public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* pointer arithmetic for alignment on short or int boundry
@ 2003-09-21 13:56 Andy Howell
  2003-09-21 14:55 ` Burak Serdar
  2003-09-21 15:40 ` Eljay Love-Jensen
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Howell @ 2003-09-21 13:56 UTC (permalink / raw)
  To: gcc-help

I need to calculate an address on a short or int boundry. For some 
reason this is not working:

char *a;

a = (a + 1) & ((char*) -2));

Gcc 3.3 on Solaris complains:

error: invalid operands of types `char*' and `
    char*' to binary `operator&'

Why shouldn't I be able to mask off the low bit?

Thanks,

	Andy

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

end of thread, other threads:[~2003-09-21 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-21 13:56 pointer arithmetic for alignment on short or int boundry Andy Howell
2003-09-21 14:55 ` Burak Serdar
2003-09-21 15:42   ` Andy Howell
2003-09-21 15:40 ` Eljay Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).