This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Compiler error indication - Continue..


Continuing my previous email I have to add the following.. (I apologise for the long listing )

Changing some attributes in the bash-script provided by John Love-Jensen (thanks!), I receive
bash-2.05a$ grep -n -w __kernel_fd_set $(echo $(e1-coff-gcc -I include/ -M init/main.c)| sed -e 's@ \\ @ @g'| cut -d ' ' -f3-)
include/linux/types.h:13:typedef __kernel_fd_set fd_set;
include/linux/posix_types.h:38:} __kernel_fd_set; */

e1-coff-gcc is the compiler I use..

I also have to state the following. Trying to transform the original typedefinition to something simpler
**...from**
typedef struct {
unsigned long fds_bits [__FDSET_LONGS];
} __kernel_fd_set;

that I receive the compiler error...
/mnt/disk2/home/gthanos/HyLinux/src/uClinux-2.4.x/include/linux/posix_types.h:38: two or more data types in declaration of `__kernel_fd_set'

**...to**
typedef unsigned long __kernel_fd_set;

The new compiler error I receive is..
/mnt/disk2/home/gthanos/HyLinux/src/uClinux-2.4.x/include/linux/posix_types.h:40: long, short, signed or unsigned invalid for `__kernel_fd_set

**QUETION: What are multiple data types within a type declaration for gcc? I don't understand...
It is not multiple definition for sure, because when I define a type twice I receive a separate/different notice about the multi-definition error.

Using the problematic linux header files in order to compile a simple source like the following one..
#include <linux/types.h>
int addi( int a, int b)
{
return (a+b);
}

int main()
{
/* fd_set is a type definition located inside the linux headers */
fd_set set;

set.fds_bits[0] = 0;
set.fds_bits[1] = 1;
set.fds_bits[2] = addi( set.fds_bits[0], set.fds_bits[1] );

return 1;
}

It passes Ok by compiling
e1-coff-gcc -S TestFile.c -I <include_path>

I am really confused and I don't understand the compiler errors I receive...
Is there anybody who can understand the error and can tell me what I have to fix or look for?

Thanks,

- George

--
________________________________________
George Thanos
National Technical University of Athens
Department of Electrical Engineering
Telecommunications Laboratory
Phone : +30 10 772 2422
email : gthanos@telecom.ece.ntua.gr
________________________________________



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]