cs50 / style50

https://cs50.readthedocs.io/style50/
GNU General Public License v3.0
61 stars 29 forks source link

dereference operator needing space #96

Open curiouskiwi opened 4 years ago

curiouskiwi commented 4 years ago

Here are 2 example lines:

int a = *(c + b + 3) + *(d + e + 3);

float b = (*(c + b + 3) + *(d + e + 3)) / 2.0;

style50 insists on a space between * and (d in the second one, which would be poor style.

style50deref

Might be confused by the parentheses? @crossroads1112

cmlsharp commented 4 years ago

I can experiment, but if astyle doesn't have some flag to fix it, the only thing to do would be to file a bug there.

Vivraan commented 3 years ago

This is also relevant for sizeof *buf kind of statements:

image

although I'd add parens just in case.