Skip to contentSkip to conversation

moving variable declarations up

Cocci Johannes Berg 1 participant 2 messages Jun 18, 2020 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 15 lines · Markus Elfring
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

+T x;

Change the + to ++

Heh, something funny happened

+ u16 *foo;
+ u16[2] bar;

... some code ...

(quoted diff) +0 -2
-u16 *foo;
-u16 *bar[2];
Quoted 8 lines
Quoted 4 lines

What happened to the array index?

I guess ... at some level I even understand it, that's a property of the type, and I was moving the type around. But I really didn't expect that

I find that there are further software development challenges to clarify.

You tried it out to move the variable “bar” which is an array of two pointers.

Oops. I just mistyped that when transcribing it to email... It was 'u16 bar[2];' in the original.

johannes

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 8 lines · Markus Elfring
Quoted 4 lines
Quoted 1 line

You tried it out to move the variable “bar” which is an array of two pointers.

Oops. I just mistyped that when transcribing it to email... It was 'u16 bar[2];' in the original.

The intended absence of asterisks can make the clarification a bit easier. Are there still any software development challenges to consider for the movement of corresponding array sizes?

Well, it's surprising that it went there? And it doesn't compile?

johannes

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci