Re: FTB due to 'too many arguments to function'

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

 



On Sun, Jan 19, 2025 at 05:28:04PM +0000, Fedora-Devel Mailing List wrote:
> Il 19/01/25 18:23, Michael J Gruber ha scritto:
> > Mattia Verga via devel venit, vidit, dixit 2025-01-19 18:19:24:
> >> I see several of my packages are FTB in the running mass rebuild due to
> >> something like:
> >>
> >> error: too many arguments to function ‘DoInterlace’; expected 0, have 1
> >>
> 
> For example:
> 
> https://kojipkgs.fedoraproject.org//work/tasks/7044/127997044/build.log

I decided to take a detailed look into this one error as a learning
example. In this case, it's a legitimate error that was introduced in
the 1.6.3 release of this software back in June 2023:

https://github.com/ahp-electronics/libahp-gt/commit/d785e134ce4aeff690c73a231ffc2660d763e5b7#diff-0f1ca71fe88ebdd7ff146df4cfad479a2816256a1f583e0ba28d3038ba8efb30R531

You can see that a call was added to

    case SetTrackingMode:
        ...
        ahp_gt_get_tracking_mode(cmd[0]);

however, in that same commit, the function was defined to take no
arguments:

    int ahp_gt_get_tracking_mode() {

And in other places, it is called without arguments:

    case GetTrackingMode:
        sprintf(msg, "%c#", ahp_gt_get_tracking_mode());

This looks like a one-letter typo as a set version of the function
exists elsewhere:

    void ahp_gt_set_tracking_mode(int mode) {

Which does take the missing argument. Also, you can see that this typo
was fixed upstream on December 4th for the 1.7.1 release:

https://github.com/ahp-electronics/libahp-gt/commit/324c0914e5dd3b23b5af5e871ba5dc0f790bddce#diff-0f1ca71fe88ebdd7ff146df4cfad479a2816256a1f583e0ba28d3038ba8efb30R541

This is something that would have always been a bug in the code, but due
to C's relaxed rules with function prototypes (prior to C23), has
simply went unnoticed for a year and a half. If you are curious, I've
created a minimal patch that fixes the build error with GCC 15. Feel
free to pull this in or reject it if you'd rather just bump to a newer
release:

https://src.fedoraproject.org/rpms/libahp-gt/pull-request/1

Hope this helps understand the build failure a little better.

> 
> I don't know much of C, from what I've read online those functions are 
> declared without arguments and then used with arguments. It seems this 
> is now throwing an error, while before the mass rebuild just worked:
> 
> /builddir/build/BUILD/libahp-gt-1.7.0-build/libahp-gt-1.7.0/ahp_gt.c: In 
> function ‘synscan_poll’:
> /builddir/build/BUILD/libahp-gt-1.7.0-build/libahp-gt-1.7.0/ahp_gt.c:541:17: 
> error: too many arguments to function ‘ahp_gt_get_tracking_mode’; 
> expected 0, have 1
>    541 |                 ahp_gt_get_tracking_mode(cmd[0]);
>        |                 ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
> In file included from 
> /builddir/build/BUILD/libahp-gt-1.7.0-build/libahp-gt-1.7.0/ahp_gt.c:26:
> /builddir/build/BUILD/libahp-gt-1.7.0-build/libahp-gt-1.7.0/redhat-linux-build/ahp_gt.h:1037:16: 
> note: declared here
>   1037 | DLL_EXPORT int ahp_gt_get_tracking_mode();
>        |                ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> Mattia
> 
> 
> -- 
> _______________________________________________
> 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, report it: https://pagure.io/fedora-infrastructure/new_issue

-- 
Loren M. Lang
lorenl@xxxxxxxxxxxxxxx
http://www.north-winds.org/
IRC: penguin359


Public Key: http://www.north-winds.org/lorenl_pubkey.asc
Fingerprint: 7896 E099 9FC7 9F6C E0ED  E103 222D F356 A57A 98FA

Attachment: signature.asc
Description: PGP signature

-- 
_______________________________________________
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, report it: https://pagure.io/fedora-infrastructure/new_issue

[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