Mentions légales du service

Skip to content

Fix support for "complex double" in parameter lists

LAWALL Julia requested to merge complex into master
Fix support for complex double in parameter lists

It seems that `parameter list` does _not_ support `complex double`,
but it _does_ support `double complex`.  Coccinelle already supports
`double complex` and `float complex` so this commit adds grammar support
for the reverse of `complex double` and `complex float`.

With this SmPL:

        @ rule1 @
        type T;
        identifier F, j;
        typedef nec_t;
        parameter list PL;
        @@

        T F(
        +nec_t *nec,
        PL
         )
        {
        ... when exists
                when any
        nec->j
        ... when exists
                when any
        }

This works:

        void qdsrc( int is, double complex v, double complex *e )
        {
          is--;
          i= nec->data.icon1[is];
        }

but this did not:

        void qdsrc( int is, complex double v, complex double *e )
        {
          is--;
          i= nec->data.icon1[is];
        }

Patch v2: Fixed: strange type2, maybe because of weird order: complex double
when patching this example function:
	static void Near_Field_Total( complex double ex, complex double ey, complex double ez, int nfeh, int idx )
	{
		nec->x++;
		return;
	}

Patch v3: Added signed-off-by.

Signed-off-by: Eric Wheeler <cocci@linux.ewheeler.net>

Merge request reports