Gcc-12 and SWIG problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a FTBFS package, audit, that has a strange problem that I'd like to 
run by the devel list. It is a common idiom in the kernel to do something 
like:

struct foo{
        unsigned int barlen;
        char bar[];
};

There are about 80 instances of this in the kernel headers. When one of these 
headers is included by SWIG, it makes code like this:

  if (arg2) {
    arg1->bar = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const 
char *)(arg2), sizeof(char)*(size));
  } else {
    arg1->bar = 0;
  }

which results in

    error: cast specifies array type

and

    error: assignment to expression with array type.

Is this intended to be an error by gcc-12?

One fix is to change the struct decalaration to bar[0];  and gcc doesn't error 
out on that. But that will take some time to get in the upstream kernel. Just 
curious if this is intended by gcc or a problem of SWIG/kernel?

Thanks,
-Steve

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux