Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Self-Assignment in ANSI C

Tags:

c

embedded

ansi

iar

I am currently working on a embedded C project and I "inherited" some old code containing statements such as:

rxStruct = rxStruct;

where rxStruct is a variable.

What could be the use of such statements?

like image 747
user1627514 Avatar asked Dec 06 '22 12:12

user1627514


1 Answers

Without further information, one use of such a statement is to prevent an unused parameter compiler warning if rxStruct is passed in as a parameter and then otherwise not used.

like image 91
acraig5075 Avatar answered Dec 18 '22 10:12

acraig5075