Skip to contentSkip to conversation

Patch macros

Cocci Andi Kleen 2 participants 4 messages Feb 14, 2014

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

Hi,

I was trying to replace static asmlinkage with static. However it always gives a cocci parsing error. I assume the problem is that asmlinkage is really a macro (for __attribute__((visible)) in my case). How to handle this in cocci?

Thanks,

-Andi

@@
type T;
@@
- static asmlinkage T
+ static T

Signature · 1 line
ak at linux.intel.com -- Speaking for myself only
#1 lore raw
Quoted 7 lines · Andi Kleen

Hi,

I was trying to replace static asmlinkage with static. However it always gives a cocci parsing error. I assume the problem is that asmlinkage is really a macro (for __attribute__((visible)) in my case). How to handle this in cocci?

Unfortunately, I don't think it is possible. The Coccinelle C parser doesn't have any notion of asmlinkage, and so it skips over it.

julia

Quoted 19 lines

Thanks,

-Andi

@@
type T;
@@
- static asmlinkage T
+ static T

--
ak at linux.intel.com -- Speaking for myself only
_______________________________________________
Cocci mailing list
Cocci at systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

author
#2 lore raw
Quoted 5 lines · Julia Lawall
Quoted 3 lines · Andi Kleen

Hi,

Quoted 7 lines
Quoted 4 lines

I was trying to replace static asmlinkage with static. However it always gives a cocci parsing error. I assume the problem is that asmlinkage is really a macro (for __attribute__((visible)) in my case). How to handle this in cocci?

Unfortunately, I don't think it is possible. The Coccinelle C parser doesn't have any notion of asmlinkage, and so it skips over it.

I was hoping there was a way to tell cocci about the macros.

Ok, back to sed then for this.

Thanks Julia.

-Andi

#3 lore raw
Quoted 11 lines · Andi Kleen
Quoted 10 lines · Julia Lawall
Quoted 7 lines · Andi Kleen

Hi,

I was trying to replace static asmlinkage with static. However it always gives a cocci parsing error. I assume the problem is that asmlinkage is really a macro (for __attribute__((visible)) in my case). How to handle this in cocci?

Quoted 4 lines
Quoted 2 lines

Unfortunately, I don't think it is possible. The Coccinelle C parser doesn't have any notion of asmlinkage, and so it skips over it.

I was hoping there was a way to tell cocci about the macros.

It can be informed about some macros, but unfortunately in this position it doesn't expect anything at all. It considers the __attribute__ things to be nonexistent as well.

julia