This is the mail archive of the
mailing list for the glibc project.
Re: parenthesis while addressing struct member
- From: JoÃl KrÃhemann <weedlight at gmail dot com>
- To: Carlos O'Donell <carlos at systemhalted dot org>
- Cc: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Sat, 26 Jul 2014 19:43:21 +0200
- Subject: Re: parenthesis while addressing struct member
- Authentication-results: sourceware.org; auth=none
- References: <53D3C580 dot 30407 at gmail dot com> <CAE2sS1gnGQccqDGfSAz=Qt+5q1Sy2QVu5xEKfJCGb8F3WZiY5w at mail dot gmail dot com>
Carlos O'Donell wrote:
On Sat, Jul 26, 2014 at 11:13 AM, JoÃl KrÃhemann <email@example.com> wrote:
I experienced problems as not using parenthesis with addressing operator.
Does someone know what's correct?
int e = INTERNAL_SYSCALL (futex, __err, 4,
private), 1, 0);
They are both the same.
The -> and . have precedence over & with left-to-right associativity.
Therefore &(struct->member) is equivalent to &struct->member.
Only () can change this e.g. *(ptr[x]) is not equivalent (*ptr)[x].
Further I really believe it should rather be of form like:
is it still the same?