0

So, I have this c module in which I have modified two things: Added one parameter to a function and added one parameter to a struct.

The thing is that, when compiling using cc (from a script I inherited), I got error messsages wherever my changes are (Sorry if the translation is not exact):

error: too many arguments for 'function_that_I_added_the_argument'
error: struct 'struct_I_added_the_element' doesn't has a member called 'element_I_added'

I've checked several times the source files (Just if the script were calling an old version) but everything seems to be fine.

Right now I'm clueless. Any idea?

EDIT: Added part of the make per popular petition: Let be:

· the path to the files.

· module1.c the module where the function I modified is.

 cc -c //folder/module1.c -Wall -DLINUX -I/ -I//otherFolder -I//include -o //folder/module1.o

I haven't included source as it is as straightforward as a function and struct declaration can be: short int value; (for the struct) and function(params..., short param) for the function.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Neuromante
  • 531
  • 2
  • 12
  • 29
  • 2
    Without the "script" we're going to be pretty clueless as well. – Some programmer dude Apr 28 '14 at 10:33
  • 2
    Add relevant parts of the sources to the post. – 0xF1 Apr 28 '14 at 10:33
  • It looks like the header files haven't been updated. If you run just the preprocessor (option `-E` to the compiler), you can look at the preprocessed files. – Klas Lindbäck Apr 28 '14 at 10:51
  • @Don'tYouWorryChild For function, you have three places to check: its declaration, its defintion, and callings of that function. All three need to match with each other. – Lee Duhem Apr 28 '14 at 10:51
  • 1
    If you solve a problem, don't edit your post to say "solved". Post an answer and then accept it. – M.M Apr 28 '14 at 11:31
  • 1
    @MattMcNabb: Sorry, but as I'm a new user I can't answer (yet, and for over 4 hours more) my own post, so I decided to edit the name to prevent luring people into an already solved issue – Neuromante Apr 28 '14 at 12:29
  • OK, fair enough. Those min-reputation restrictions are more of a hindrance than a help IMHO. OTOH you almost never see spam here. – M.M Apr 28 '14 at 12:31

1 Answers1

0

Two years later, I remembered to auto answer me and mark this as solved, so, copy paste from my own edit:

Solved:

Finally found the problems...

a) The project had declared two structs (struct petecander and struct structPetecander), and the compiler was telling me about "struct structPetecander" not having an element of structPetecander. Of course it didn't have it as it was another struct with a damn similar name.

b) I was getting a "too many arguments for function_that_I_added_the_argument". Too many time programming in Java made me forgot that in C you have to declare in a .h the function

Two error messages (buried below the other errors) gave me the hint. Sorry for the bad translation: /module.c:: error: conflict type for /headers.h:: error previous declaration of was here

Time to go to cry a bit to a corner, I guess.

Neuromante
  • 531
  • 2
  • 12
  • 29