Prototypes in c

Prototypes in c

I havea lot oflegacy code in c. Each function is prototyped in a separate header file tha contains all of the functions definitions.

1. When I made main.c a main.cilk and compiled all was fine -I included cilk-lib.cilkh in the include section for main.cilk. I also preceded main with th word cilk for cilk main. I compiled with no errors.

2. The called function WEG.c from cilk main was spawned next. The WEG.c was changed to WEG.cilk and againcilk-lib.cilkh was included in the WEG.cilk include and WEG.c name changed to WEG.cilk giving the WEG function in WEG.cilk a new definition.This caused an error:

WEG.cilk.95: identifier "WEG" redeclared
Previous declaration in WEGfundefs.h

Compilation failed. . .

Of course, I didredeclare it and that creates the errror. There is no prototype for WEG.cilk, but there is one for WEG.c. What should I do. The function WEG in WEG.cilk is now cilk WEG.

Do I eliminate/redefine the protoptype? Add a prototype for cilk WEG function?

Any help appreciated. Thanks in advance.


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

If your code is using "cilk-lib.cilkh", it sounds like youare now using MIT Cilk? As mentioned earlier, MIT Cilk is no longer supported / maintained by anyone (as far as I know).

From what I remember, you can create ".cilkh" files, to define prototypes for Cilk functions instead of ".h" files. I believe in some cases, the MIT Cilk "compiler' treats ".h" files as C code. Beyond that, your guess is as probably as good as mine. You may need to do some experimentation to figure it out.


Leave a Comment

Please sign in to add a comment. Not a member? Join today