Re: [PATCH 5/9] bfs: move function prototype to the proper header file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Adrian Bunk
Date: Friday, January 25, 2008 - 3:42 am

On Thu, Jan 24, 2008 at 11:22:21PM +0000, Tigran Aivazian wrote:

fs/bfs/bfs.h is not visible to the rest of the kernel, it's the right 
place for bfs-internal code.

Whether there's an "extern" written is just a syntax thing with zero 
semantical implications. We tend to not write the "extern" in the 
kernel, but that's nothing cast in stone.

But prototypes really belong into header files - bugs in this area are 
rare, but when they occur they can cause nasty hard-to-debug bugs
(e.g. depending on the calling convention on the architecture calling 
the function can turn your stack into garbage), and with the prototypes 
in header files gcc can do type checks.


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/9] bfs: assorted cleanups, Dmitri Vorobiev, (Thu Jan 24, 3:31 pm)
[PATCH 1/9] bfs: remove a useless variable, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
[PATCH 2/9] bfs: coding style cleanup in fs/bfs/inode.c, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
[PATCH 3/9] bfs: coding style cleanup in fs/bfs/bfs.h, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
[PATCH 4/9] bfs: coding style cleanup in fs/bfs/dir.c, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
[PATCH 6/9] bfs: coding style cleanup in fs/bfs/file.c, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
[PATCH 8/9] bfs: remove multiple assignments, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
[PATCH 9/9] bfs: use the proper header file for inclusion, Dmitri Vorobiev, (Thu Jan 24, 3:32 pm)
Re: [PATCH 0/9] bfs: assorted cleanups, Dmitri Vorobiev, (Fri Jan 25, 3:25 am)
Re: [PATCH 5/9] bfs: move function prototype to the proper ..., Adrian Bunk, (Fri Jan 25, 3:42 am)