EmbeddedRelated.com
Forums

Implicit decleration warning for Assembler functions in header file

Started by grubmg August 20, 2007
Hello All.

I am working on a project that incorporates both C and Assembly
functions in several modules. I have followed through with the
requirments stated in the IAR manuals and the TI document (SLAA140)
concerning the correct usage.

My problem is, that when I want to use these Assembly functions as part
of the modules in my "Main" module, I receive the warning that the
function is "implicitly defined" even though I declare the Assembly
function in the C module as "extern" and have also added the decleration
in that modules' header file.

I shall demonstrate what I mean:

Assembly function definition (in file RTC_asm.s43):
---------------
PUBLIC initRTC

initRTC NOP
MOV.W #0, &TimeCount
BIC #TAIFG, &TACTL
MOV #TASSEL_1+ID_3+MC_2+TAIE+TACLR, &TACTL
RET

Decleration in RTC C module (in file RTC_c.c):
-----------
extern void initRTC(void);

Decleration in RTC module header file, for use in other modules
(RTC_c.h):
-------------------------------
void initRTC(void);

And, finally, the usage in my main module:
------
#include "RTC_c.h"
...
initRTC();

For this I receive:
Warning[Pe223]: function "initRTC" declared implicitly
C:\Eltav\Projects\VDA\VDAMain.c 176

All files are included in the project. The program works, though. It
makes it to the right function. But I have other functions which require
argument passing and returning, and I am afraid they might not work.

Now, what really bugs me, is that I have other Assembly functions in
that same module (and others), declared in the exact same way, which
don't create that warning. Why this discrimenation?

Beginning Microcontrollers with the MSP430

Hello grubmg,
I think if you modify your setup to the following your warning should
disappear.
1. place the 'extern void initRTC(void);' in rtc.h not rtc.c
2. you do not need the RTC.C file at all

HTH Please let us know how you get on.
Regards,
Ivan Vernot

----- Original Message -----
From: "grubmg"
To:
Sent: Monday, August 20, 2007 8:35 PM
Subject: [msp430] Implicit decleration warning for Assembler functions in
header file
>
> Hello All.
>
> I am working on a project that incorporates both C and Assembly
> functions in several modules. I have followed through with the
> requirments stated in the IAR manuals and the TI document (SLAA140)
> concerning the correct usage.
>
> My problem is, that when I want to use these Assembly functions as part
> of the modules in my "Main" module, I receive the warning that the
> function is "implicitly defined" even though I declare the Assembly
> function in the C module as "extern" and have also added the decleration
> in that modules' header file.
>
> I shall demonstrate what I mean:
>
> Assembly function definition (in file RTC_asm.s43):
> ---------------
> PUBLIC initRTC
>
> initRTC NOP
> MOV.W #0, &TimeCount
> BIC #TAIFG, &TACTL
> MOV #TASSEL_1+ID_3+MC_2+TAIE+TACLR, &TACTL
> RET
>
> Decleration in RTC C module (in file RTC_c.c):
> -----------
> extern void initRTC(void);
>
> Decleration in RTC module header file, for use in other modules
> (RTC_c.h):
> -------------------------------
> void initRTC(void);
>
> And, finally, the usage in my main module:
> ------
> #include "RTC_c.h"
> ...
> initRTC();
>
> For this I receive:
> Warning[Pe223]: function "initRTC" declared implicitly
> C:\Eltav\Projects\VDA\VDAMain.c 176
>
> All files are included in the project. The program works, though. It
> makes it to the right function. But I have other functions which require
> argument passing and returning, and I am afraid they might not work.
>
> Now, what really bugs me, is that I have other Assembly functions in
> that same module (and others), declared in the exact same way, which
> don't create that warning. Why this discrimenation?
>
> Yahoo! Groups Links
>
Hi Ivan,

Thanks for the quick reply. Actually that solution was my first
version, which didn't work...

..Or so I thought...

I found the problem, which is of course... Me.

I was working on a header file from within the RTC modules folder,
while the project was reading the header file (an older version of
it, and not the one I was changing) from it's own folder.

he he...

I hate those. Thanks for the help, anyway. It works just the way I
described it.

-Moshe Goren

--- In m..., "Ivan Vernot" wrote:
>
> Hello grubmg,
> I think if you modify your setup to the following your warning
should
> disappear.
> 1. place the 'extern void initRTC(void);' in rtc.h not rtc.c
> 2. you do not need the RTC.C file at all
>
> HTH Please let us know how you get on.
> Regards,
> Ivan Vernot
>
> ----- Original Message -----
> From: "grubmg"
> To:
> Sent: Monday, August 20, 2007 8:35 PM
> Subject: [msp430] Implicit decleration warning for Assembler
functions in
> header file
> >
> > Hello All.
> >
> > I am working on a project that incorporates both C and Assembly
> > functions in several modules. I have followed through with the
> > requirments stated in the IAR manuals and the TI document
(SLAA140)
> > concerning the correct usage.
> >
> > My problem is, that when I want to use these Assembly functions
as part
> > of the modules in my "Main" module, I receive the warning that the
> > function is "implicitly defined" even though I declare the
Assembly
> > function in the C module as "extern" and have also added the
decleration
> > in that modules' header file.
> >
> > I shall demonstrate what I mean:
> >
> > Assembly function definition (in file RTC_asm.s43):
> > ---------------
> > PUBLIC initRTC
> >
> > initRTC NOP
> > MOV.W #0, &TimeCount
> > BIC #TAIFG, &TACTL
> > MOV #TASSEL_1+ID_3+MC_2+TAIE+TACLR, &TACTL
> > RET
> >
> > Decleration in RTC C module (in file RTC_c.c):
> > -----------
> > extern void initRTC(void);
> >
> > Decleration in RTC module header file, for use in other modules
> > (RTC_c.h):
> > ------------------------------
-
> > void initRTC(void);
> >
> > And, finally, the usage in my main module:
> > ------
> > #include "RTC_c.h"
> > ...
> > initRTC();
> >
> > For this I receive:
> > Warning[Pe223]: function "initRTC" declared implicitly
> > C:\Eltav\Projects\VDA\VDAMain.c 176
> >
> > All files are included in the project. The program works, though.
It
> > makes it to the right function. But I have other functions which
require
> > argument passing and returning, and I am afraid they might not
work.
> >
> > Now, what really bugs me, is that I have other Assembly functions
in
> > that same module (and others), declared in the exact same way,
which
> > don't create that warning. Why this discrimenation?
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
>