Ok. I was going for termios, but…
I have generated a simple web page, so i could use it to output some data.
I’ve started to generate my own functions under index_v.c, and ran into strange problems.
First, i cannot open a com port straight at index_v.c. If i do a following piece of code:
int fd;
fd = open(“/com/0”, O_RDWR);
The compiler cries about:
/pbuilder/html/index_v.c -o objs/index_v.o
…/pbuilder/html/index_v.c:21: warning: type defaults to int' in declaration of
fd’
…/pbuilder/html/index_v.c:21: warning: implicit declaration of function `open’
…/pbuilder/html/index_v.c:21: initializer element is not constant
…/pbuilder/html/index_v.c:21: warning: data definition has no type or storage c
lass
So is this just a totally wrong place to do this?
Second, i was going to use pointers, because if i declare my own funtion and call it, i can use the above code in the function… But.
As from my early lessons in c, i defined
int initializeserial(int *ptr1);
and the code:
int filepointer;
filepointer=(int)calloc(1,sizeof(int));
int alusta = initializeserial(int *filepointer);
This isn’t good either, i get:
/pbuilder/html/index_v.c -o objs/index_v.o
…/pbuilder/html/index_v.c:35: warning: type defaults to int' in declaration of
filepointer’
…/pbuilder/html/index_v.c:35: conflicting types for filepointer' ../pbuilder/html/index_v.c:34: previous declaration of
filepointer’
…/pbuilder/html/index_v.c:35: warning: implicit declaration of function `calloc
’
…/pbuilder/html/index_v.c:35: warning: initialization makes integer from pointe
r without a cast
…/pbuilder/html/index_v.c:35: initializer element is not constant
…/pbuilder/html/index_v.c:35: warning: data definition has no type or storage c
lass
I also tried passing an empty pointer, with no luck (thought about using malloc or calloc in my own function).
I am using upgraded dev kit, with gcc 3.2. Could this be cause of the newer gcc? Or is it just me… I’m not much of a programmer, but in this I think I am using quite simple things that have always worked (at least placing a return value in variable…)