xfs
[Top] [All Lists]

Warnings when compiling xfs_macros.c

To: linux-xfs@xxxxxxxxxxx
Subject: Warnings when compiling xfs_macros.c
From: Craig Rodrigues <rodrigc@xxxxxxxxxxxxxx>
Date: Wed, 7 Sep 2005 13:45:35 -0400
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.9i
Hi,

I am trying to eliminate compilation errors when compiling
XFS code on FreeBSD.  I've gotten rid of most of them,
but am having problems with xfs_macros.c.
The FreeBSD kernel build adds the flag -Wmissing-prototypes,
and I am getting lots of warnings like this:

cc -c -O -pipe  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
-Wpointer-arith -Winline -Wcast-qual  -ffo
rmat-extensions -std=c99 -g -nostdinc -I-  -I. -I/usr/src/sys 
-I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/a
ltq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf 
-I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/
ath/freebsd -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa 
-I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/
xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -D_KERNEL -include opt_global.h 
-fno-common -finline-limit=8000 --param in
line-unit-growth=100 --param large-function-growth=1000  
-mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx
-mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Werror  
/usr/src/sys/gnu/fs/xfs/xfs_macros.c

/usr/src/sys/gnu/fs/xfs/xfs_macros.c:2234: warning: no previous prototype for 
'xlog_grant_add_space'
/usr/src/sys/gnu/fs/xfs/xfs_macros.c:2242: warning: no previous prototype for 
'xlog_grant_sub_space'

I see that in xfs_macros.c, we have:



#if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XLOG_GRANT_ADD_SPACE)
void
xlog_grant_add_space(xlog_t *log, int bytes, int type)
{
        XLOG_GRANT_ADD_SPACE(log, bytes, type);
}
#endif
 
#if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XLOG_GRANT_SUB_SPACE)  
void
xlog_grant_sub_space(xlog_t *log, int bytes, int type)
{
        XLOG_GRANT_SUB_SPACE(log, bytes, type);
} 
#endif


Would it be acceptable if I submitted a patch which told gcc to shut up by 
doing something like
this in the header file:


==== //depot/projects/freebsd/kern/xfs/xfs_log_priv.h#9 - 
/opt/home/rodrigc/xfs/project/xfs_log_priv.h ====
--- /tmp/tmp.1941.0     Wed Sep  7 13:44:47 2005
+++ /opt/home/rodrigc/xfs/project/xfs_log_priv.h        Wed Sep  7 13:42:47 2005
@@ -126,8 +126,11 @@
     ((i) >> 24)
 #endif
 
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_GRANT_SUB_SPACE)
+#if XFS_WANT_FUNCS || XFS_WANT_FUNCS_C || (XFS_WANT_SPACE && 
XFSSO_XLOG_GRANT_SUB_SPACE)
 void xlog_grant_sub_space(struct log *log, int bytes, int type);
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_GRANT_SUB_SPACE)
 #define XLOG_GRANT_SUB_SPACE(log,bytes,type)   \
        xlog_grant_sub_space(log,bytes,type)
 #else
@@ -148,8 +151,13 @@
         }                                                              \
     }
 #endif
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_GRANT_ADD_SPACE)
+
+
+#if XFS_WANT_FUNCS || XFS_WANT_FUNCS_C || (XFS_WANT_SPACE && 
XFSSO_XLOG_GRANT_ADD_SPACE)
 void xlog_grant_add_space(struct log *log, int bytes, int type);
+#endif
+
+#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_GRANT_ADD_SPACE)
 #define XLOG_GRANT_ADD_SPACE(log,bytes,type)   \
        xlog_grant_add_space(log,bytes,type)
 #else

-- 
Craig Rodrigues        
rodrigc@xxxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>