Hi,
hab da mal wieder, ein frustrierendes Anfänger Problem :(
Wenn ich Funktionen aus string.h in der Main benutze, funktioniert alles
ohne Probleme.
Setze ich sie aber in einer eigenen Funktion ein, kommt es zu folgender
Fehlermeldung:
user.c:23: warning: (361) function declared implicit int
C:\Program Files (x86)\Microchip\xc8\v1.32\sources\common\itoa.c:4:
error: (1098) conflicting declarations for variable "_itoa" (user.c:23)
Die Warnung wird immer ausgegeben, egal was ich da für einen Type
deklariere!
Die Erklärung zum Error, sagt mir in diesem Zusammenhang auch nichts.
(1098) conflicting declarations for variable "*" (*:*) (Parser, Code
Generator)
Differing type information has been detected in the declarations for a
variable, or between a declaration and the definition of a variable, for
example:
extern long int test;
int test; /* oops -- which is right? int or long int ? */
Hier der Code dazu:
1 | #include <xc.h> /* XC8 General Include File */
|
2 | #include <stdint.h> /* For uint8_t definition */
|
3 | #include <stdbool.h> /* For true/false definition */
|
4 | #include <string.h>
|
5 |
|
6 | #include "LCD_HD44780.h"
|
7 | #include "user.h"
|
8 |
|
9 | void Print_Zeit(int val); // liegt in user.h
|
10 |
|
11 | void Print_Zeit(int val) { // liegt in user.c, wird in main aufgerufen
|
12 | char PBuff[3];
|
13 | itoa(PBuff, val, 10);
|
14 | if (val < 10) {
|
15 | LCD_Print("0");
|
16 | }
|
17 | LCD_Print(PBuff);
|
18 | }
|
Die Impementation von itoa:
1 | char *
|
2 | itoa(char * buf, int val, int base)
|
3 | {
|
4 | char * cp = buf;
|
5 |
|
6 | if(val < 0) {
|
7 | *buf++ = '-';
|
8 | val = -val;
|
9 | }
|
10 | utoa(buf, val, base);
|
11 | return cp;
|
12 | }
|
Ich habe nicht den geringsten Schimmer, was da quer schlägt?
Ich danke schon mal für eure Mühen.