Re: Question gcc

Pàgina inicial

Reply to this message
Autor: Raphaël Dorado
Data:  
A: guilde
Assumpte: Re: Question gcc
Le 12/07/2022 à 18:40, Patrick Dupre a écrit :
> extern core_str* init_struct () ;
>
> (ainsi que la function qui va avec dans le .c)
>
> Je fais un appel :
>
>    param.data_conv = init_struct () ;
>    init_struct (param.data_conv) ;


Si tu déclares la fonction en précisant qu'elle ne prend par d'argument ("()"
-> "(void)"):

    extern core_str* init_struct (void) ;


Tu devrais obtenir ceci même sans options -W* :

    error: too many arguments to function ‘init_struct’
    init_struct (param.data_conv) ;


--Raf