c - Extra parentheses near arrow operator -


a program i'm trying decode includes following line:

#define nn(sp)   ((sp)->nn) 

from context (not shown), i'm pretty sure 'sp' pointer struct contains 'nn' 1 of variables.

in expression "((sp)->nn)", inner set of parentheses serve conceivable purpose? if not, might outer set of parentheses serve no purpose?

#define nn(sp)   ((sp)->nn) 

the inner parentheses required. if pass pointer p + 10 or *p nn macro, troubles without inner parentheses -> has higher precedence + , unary *.

the outer parentheses not required here expression involves postfix operation , no operator has greater precedence postfix operators.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -