[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C question



yeah, you need to find out what data type those variables are and cast it.

a = b = c = (typeofvariable) 0;



>in the definition of inode in the inode.h file, how are i_mtime, i_ctime,
>and i_atime defined?  it might be that assigning a int to them is not
>possible.  you might need to assign '0', or use NULL.  i don't have a
>linux box handy or i would be more help here.  but it appears that you are
>trying to cross data types when given the anal error checking in kernel
>compiles, it ain't going ot happen.
>
> > >> fs/cramfs/inode.c: In function `get_cramfs_inode':
> > >> fs/cramfs/inode.c:54: incompatible types in assignment
> > >>
> > >> Going to /usr/src/linux-2.5.66/fs/cramfs and looking at inode.c line
> > >> 54 I found:
> > >>                 inode->i_mtime = inode->i_atime = inode->i_ctime = 0;
> > >
> > > it looks like you have an issue with stancking your pointers like 
>that.
> > >  this might work in a newer version of glibc than you are running.  if
> > > you  were to take these down to:
> > >
> > > 	inode->i_mtime = 0;
> > > 	inode->i_atime = 0;
> > > 	inode->i_ctime = 0;
> > >
> > > and then recompile, what would this do?  You aren't adding cpu cycles,
> > > and  you are cutting down on the memory lookups so you might even be
> > > cutting  down on the time some.  You can do alot of really messed up
> > > things with C.   ALOT.
> >
> > Tighe,
> >
> > Well... It looked like a perfectly reasoned answer to the problem. I 
>guess
> > that was reason enough for it not to work.  :-/
> >
> > After modifying inode.c, the next pass of 'make rpm' produced similar, 
>but
> > more numerous errors:
> >
> > ...
> > fs/cramfs/.tmp_inode.o fs/cramfs/inode.c
> > fs/cramfs/inode.c: In function `get_cramfs_inode':
> > fs/cramfs/inode.c:56: incompatible types in assignment
> > fs/cramfs/inode.c:57: incompatible types in assignment
> > fs/cramfs/inode.c.58: incompatible types in assignment
> > make[4]: *** [fs/cramfs/inode.o] Error 1
> > make[3]: *** [fs/cramfs] Error 2
> > make[2]: *** [fs] Error 2
> > make[1]: *** [all] Error 2
> > error: Bad exit status from /var/tmp/rpm-tmp.98168 (%build)
> > RPM build errors:
> >     Bad exit status from /var/tmp/rpm-tmp.98168 (%build)
> > make: *** [rpm] Error 1
> >
> > Guess it's time to start lurking about lkml.....  Thanks.
> >
> > --Doc
> >
> >
> >
> > -
> > To unsubscribe, send email to majordomo@silug.org with
> > "unsubscribe silug-discuss" in the body.
> >
>
>--
>Tighe Schlottog         workape         fiaid
>"Nothing is too cruel if it is funny enough."
>
>
>-
>To unsubscribe, send email to majordomo@silug.org with
>"unsubscribe silug-discuss" in the body.


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus


-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.