All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] adding function declarations
@ 2015-01-01 14:43 Christof Warlich
  2015-01-01 16:02 ` Julia Lawall
  2015-01-01 17:33 ` Julia Lawall
  0 siblings, 2 replies; 11+ messages in thread
From: Christof Warlich @ 2015-01-01 14:43 UTC (permalink / raw)
  To: cocci

Hi,

being absolutely new to Coccinelle, I see that fascinating things can be 
done with it, but I kind of fail to adopt things towards my own needs:

I'd like to adapt the header files of a huge C project (gcc) so that 
they may alternatively be included by C++ (g++) code. But many of the 
header files do contain numerous inline function definitions of the form

static inline __attribute__((always_inline)) <someReturnType> 
<someFunctionName>(<someParameters) {
     <someCode>
}

While gcc happily accepts this type of code, g++ complains that 
specifying attributes is not allowed during function definition, but 
only during function declaration. Thus, the fix is straight forward: All 
these occurrences must be replaced by something like

static inline __attribute__((always_inline)) <someReturnType> 
<someFunctionName>(<someParameters);
<someReturnType> <someFunctionName>(<someParameters) {
     <someCode>
}

Can anyone give me some guidance on how I can express this as a semantic 
patch?

Thanks for any help,

Chris

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-01-02 11:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-01 14:43 [Cocci] adding function declarations Christof Warlich
2015-01-01 16:02 ` Julia Lawall
2015-01-01 19:06   ` Christof Warlich
2015-01-01 19:54     ` Julia Lawall
2015-01-01 23:50       ` Christof Warlich
2015-01-02  6:05         ` Julia Lawall
2015-01-02  8:23           ` Christof Warlich
2015-01-01 17:33 ` Julia Lawall
2015-01-02 10:22   ` Christof Warlich
2015-01-02 10:30     ` Julia Lawall
2015-01-02 11:11       ` Christof Warlich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.