linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@mindspring.com>
To: C programming list <linux-c-programming@vger.kernel.org>
Subject: pointer indirection on the LHS of an assignment
Date: Sat, 7 Oct 2006 09:12:07 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610070909590.6332@localhost.localdomain> (raw)


  sort of a combination of a C and gcc question but what's the rules
these days on the following (ripped from the linux kernel source, from
asm/semaphore.h)?

===
static inline void sema_init (struct semaphore *sem, int val)
{
/*
 *      *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
 *
 * i'd rather use the more flexible initialization above, but sadly
 * GCC 2.7.2.3 emits a bogus warning. EGCS doesn't. Oh well.
 */
        atomic_set(&sem->count, val);
        sem->sleepers = 0;
        init_waitqueue_head(&sem->wait);
}
===

  i recall that earlier compilers complained about that first example
of pointer indirection as the target of an assignment.  is that legal
these days?

rday

             reply	other threads:[~2006-10-07 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-07 13:12 Robert P. J. Day [this message]
2006-10-07 22:53 ` pointer indirection on the LHS of an assignment Glynn Clements
2006-10-08  6:53   ` Robert P. J. Day
2006-10-08 12:17     ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0610070909590.6332@localhost.localdomain \
    --to=rpjday@mindspring.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).