+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * MCONFIG.in (WFLAGS): Add additional warning checks. Remove
+ --traditional since newer versions of gcc are overly annoying.
+
+2003-07-05 Theodore Ts'o <tytso@mit.edu>
+
+ * Add workaround for Libintl / Darwin incompatibility. Apparently
+ Darwin's gcc doesn't like the __asm__ statements used by
+ libintl to redirect the system-provided gettext calls.
+
2003-06-08 Theodore Ts'o <tytso@mit.edu>
* configure.in: Adjust defaults for FreeBSD to no longer build the
# Run make gcc-wall to do a build with warning messages.
#
#
-WFLAGS= -ansi -D_POSIX_SOURCE -pedantic \
+WFLAGS= -ansi -D_POSIX_SOURCE -pedantic $(WFLAGS_EXTRA) \
-Wall -Wwrite-strings -Wpointer-arith \
- -Wcast-qual -Wcast-align -Wtraditional \
+ -Wcast-qual -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes \
+ -Wformat-security -Wformat-nonliteral \
+ -Wmissing-format-attribute \
-Wnested-externs -Winline -DNO_INLINE_FUNCS -Wshadow
gcc-wall-new:
+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * debugfs.c (do_imap): Fix gcc -Wall nitpicks (printf format types).
+
2003-05-21 Theodore Ts'o <tytso@mit.edu>
* unused.c (do_dump_unused): Add new command which dumps the
block;
offset &= (EXT2_BLOCK_SIZE(current_fs->super) - 1);
- printf("Inode %d is part of block group %d\n"
- "\tlocated at block %d, offset 0x%04x\n", ino, group,
+ printf("Inode %d is part of block group %lu\n"
+ "\tlocated at block %lu, offset 0x%04lx\n", ino, group,
block_nr, offset);
}
+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * pass2.c: Fix gcc -Wall nitpicks (missing #include <string.h>)
+
+ * dict.c, dict.h: Fix gcc -Wall nitpicks (indented cpp directives)
+
2003-06-8 Theodore Ts'o <tytso@mit.edu>
* problem.c: Fix spelling error.
assert (!dnode_is_in_a_dict(newnode));
assert (dict->nodecount < dict->maxcount);
- #ifndef NDEBUG
+#ifndef NDEBUG
if (dict->nodecount > 0) {
if (dict->dupes)
assert (dict->compare(nil->left->key, key) <= 0);
else
assert (dict->compare(nil->left->key, key) < 0);
}
- #endif
+#endif
newnode->key = key;
nil->right->left = newnode;
copyleft:
{
dnode_t *next = dict_next(dest, leftnode);
- #ifndef NDEBUG
+#ifndef NDEBUG
leftnode->left = NULL; /* suppress assertion in dict_load_next */
- #endif
+#endif
dict_load_next(&load, leftnode, leftnode->key);
leftnode = next;
continue;
copyright:
{
dnode_t *next = dict_next(source, rightnode);
- #ifndef NDEBUG
+#ifndef NDEBUG
rightnode->left = NULL;
- #endif
+#endif
dict_load_next(&load, rightnode, rightnode->key);
rightnode = next;
continue;
typedef enum { dnode_red, dnode_black } dnode_color_t;
typedef struct dnode_t {
- #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
struct dnode_t *dict_left;
struct dnode_t *dict_right;
struct dnode_t *dict_parent;
dnode_color_t dict_color;
const void *dict_key;
void *dict_data;
- #else
+#else
int dict_dummy;
- #endif
+#endif
} dnode_t;
typedef int (*dict_comp_t)(const void *, const void *);
typedef void (*dnode_free_t)(dnode_t *, void *);
typedef struct dict_t {
- #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
dnode_t dict_nilnode;
dictcount_t dict_nodecount;
dictcount_t dict_maxcount;
dnode_free_t dict_freenode;
void *dict_context;
int dict_dupes;
- #else
+#else
int dict_dummmy;
- #endif
+#endif
} dict_t;
typedef void (*dnode_process_t)(dict_t *, dnode_t *, void *);
typedef struct dict_load_t {
- #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
dict_t *dict_dictptr;
dnode_t dict_nilnode;
- #else
+#else
int dict_dummmy;
- #endif
+#endif
} dict_load_t;
extern dict_t *dict_create(dictcount_t, dict_comp_t);
* - The inode_reg_map bitmap
*/
+#include <string.h>
+
#include "e2fsck.h"
#include "problem.h"
#include "dict.h"
+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * blkid_types.h.in: Fix gcc -Wall nitpicks (don't use #elsif)
+
+ * cache.c: Fix gcc -Wall nitpicks (missing #include <string.h>)
+
+ * probe.h: Fix gcc -Wall nitpicks (missing casts)
+
2003-05-21 Theodore Ts'o <tytso@mit.edu>
* Makefile.in (ELF_OTHER_LIBS): The blkid library depends on the
#if (@SIZEOF_INT@ == 8)
typedef int __s64;
typedef unsigned int __u64;
-#elif (@SIZEOF_LONG@ == 8)
+#else
+#if (@SIZEOF_LONG@ == 8)
typedef long __s64;
typedef unsigned long __u64;
-#elif (@SIZEOF_LONG_LONG@ == 8)
+#else
+#if (@SIZEOF_LONG_LONG@ == 8)
#if defined(__GNUC__)
typedef __signed__ long long __s64;
#else
typedef signed long long __s64;
-#endif
+#endif /* __GNUC__ */
typedef unsigned long long __u64;
-#endif
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
#if (@SIZEOF_INT@ == 2)
typedef int __s16;
typedef unsigned int __u16;
-#elif (@SIZEOF_SHORT@ == 2)
+#else
+#if (@SIZEOF_SHORT@ == 2)
typedef short __s16;
typedef unsigned short __u16;
#else
?==error: undefined 16 bit type
-#endif
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
#if (@SIZEOF_INT@ == 4)
typedef int __s32;
typedef unsigned int __u32;
-#elif (@SIZEOF_LONG@ == 4)
+#else
+#if (@SIZEOF_LONG@ == 4)
typedef long __s32;
typedef unsigned long __u32;
-#elif (@SIZEOF_SHORT@ == 4)
+#else
+#if (@SIZEOF_SHORT@ == 4)
typedef short __s32;
typedef unsigned short __u32;
#else
?== error: undefined 32 bit type
-#endif
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
#endif /* _*_TYPES_H */
*/
#include <stdlib.h>
+#include <string.h>
#include "blkidP.h"
int blkid_debug_mask = 0;
js = (struct jfs_super_block *)buf;
- if (strlen(js->js_label))
- blkid_set_tag(dev, "LABEL", js->js_label,
+ if (strlen((char *) js->js_label))
+ blkid_set_tag(dev, "LABEL", (char *) js->js_label,
sizeof(js->js_label));
set_uuid(dev, js->js_uuid);
return 0;
ros = (struct romfs_super_block *)buf;
/* can be longer, padded to a 16 bytes boundary */
- if (strlen(ros->ros_volume)) {
- blkid_set_tag(dev, "LABEL", ros->ros_volume,
- (strlen(ros->ros_volume)|15)+1);
+ if (strlen((char *) ros->ros_volume)) {
+ blkid_set_tag(dev, "LABEL", (char *) ros->ros_volume,
+ (strlen((char *) ros->ros_volume)|15)+1);
}
return 0;
}
+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * iod.c: Fix gcc -Wall nitpicks (missing #include <string.h>)
+
2003-04-21 Theodore Ts'o <tytso@mit.edu>
* Release of E2fsprogs 1.33
#include <unistd.h>
#endif
#include <stdlib.h>
+#include <string.h>
int iterate_on_dir (const char * dir_name,
int (*func) (const char *, struct dirent *, void *),
+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * kernel-jbd.h, flushb.c: Fix gcc -Wall nitpicks (indented cpp
+ directives)
+
+ * ext2_types.h.in, initialize.c: Fix gcc -Wall nitpicks
+ (don't use #elsif)
+
+ * ismounted.c: Fix gcc -Wall nitpicks (Don't use exit as a goto label)
+
+ * llseek.c: Fix gcc -Wall nitpicks (don't use #elsif)
+
+ * lookup.c, read_bb.c: Fix gcc -Wall nitpicks (indent
+ non-traditional #pragma)
+
+ * test_io.c: Fix gcc -Wall nitpicks (const/unsigned type issues)
+
2003-06-24 <tytso@snap.thunk.org>
* badblocks.c, ext2fs.h (ext2fs_u32_list_find,
#define i_gid_high osd2.linux2.l_i_gid_high
#define i_reserved2 osd2.linux2.l_i_reserved2
-#elif defined(__GNU__)
+#else
+#if defined(__GNU__)
#define i_translator osd1.hurd1.h_i_translator
#define i_frag osd2.hurd2.h_i_frag;
#define i_gid_high osd2.hurd2.h_i_gid_high
#define i_author osd2.hurd2.h_i_author
-#elif defined(__masix__)
+#else
+#if defined(__masix__)
#define i_reserved1 osd1.masix1.m_i_reserved1
#define i_frag osd2.masix2.m_i_frag
#define i_fsize osd2.masix2.m_i_fsize
#define i_reserved2 osd2.masix2.m_i_reserved2
+#endif /* __masix__ */
+#endif /* __GNU__ */
#endif /* defined(__KERNEL__) || defined(__linux__) */
/*
#if (@SIZEOF_INT@ == 8)
typedef int __s64;
typedef unsigned int __u64;
-#elif (@SIZEOF_LONG@ == 8)
+#else
+#if (@SIZEOF_LONG@ == 8)
typedef long __s64;
typedef unsigned long __u64;
-#elif (@SIZEOF_LONG_LONG@ == 8)
+#else
+#if (@SIZEOF_LONG_LONG@ == 8)
#if defined(__GNUC__)
typedef __signed__ long long __s64;
#else
typedef signed long long __s64;
-#endif
+#endif /* __GNUC__ */
typedef unsigned long long __u64;
-#endif
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
#if (@SIZEOF_INT@ == 2)
typedef int __s16;
typedef unsigned int __u16;
-#elif (@SIZEOF_SHORT@ == 2)
+#else
+#if (@SIZEOF_SHORT@ == 2)
typedef short __s16;
typedef unsigned short __u16;
#else
?==error: undefined 16 bit type
-#endif
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
#if (@SIZEOF_INT@ == 4)
typedef int __s32;
typedef unsigned int __u32;
-#elif (@SIZEOF_LONG@ == 4)
+#else
+#if (@SIZEOF_LONG@ == 4)
typedef long __s32;
typedef unsigned long __u32;
-#elif (@SIZEOF_SHORT@ == 4)
+#else
+#if (@SIZEOF_SHORT@ == 4)
typedef short __s32;
typedef unsigned short __u32;
#else
?== error: undefined 32 bit type
-#endif
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
#endif /* _*_TYPES_H */
if (ioctl (fd, BLKFLSBUF, 0) == 0)
return 0;
#else
- #ifdef __GNUC__
- #warning BLKFLSBUF not defined
- #endif
+#ifdef __GNUC__
+ #warning BLKFLSBUF not defined
+#endif /* __GNUC__ */
#endif
#ifdef FDFLUSH
ioctl (fd, FDFLUSH, 0); /* In case this is a floppy */
#else
- #ifdef __GNUC__
- #warning FDFLUSH not defined
- #endif
+#ifdef __GNUC__
+ #warning FDFLUSH not defined
+#endif /* __GNUC__ */
#endif
}
return 0;
#include "ext2_fs.h"
#include "ext2fs.h"
-#if defined(__linux__) && defined(EXT2_OS_LINUX)
+#if defined(__linux__) && defined(EXT2_OS_LINUX)
#define CREATOR_OS EXT2_OS_LINUX
-#elif defined(__GNU__) && defined(EXT2_OS_HURD)
+#else
+#if defined(__GNU__) && defined(EXT2_OS_HURD)
#define CREATOR_OS EXT2_OS_HURD
-#elif defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD)
+#else
+#if defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD)
#define CREATOR_OS EXT2_OS_FREEBSD
-#elif defined(LITES) && defined(EXT2_OS_LITES)
+#else
+#if defined(LITES) && defined(EXT2_OS_LITES)
#define CREATOR_OS EXT2_OS_LITES
#else
#define CREATOR_OS EXT2_OS_LINUX /* by default */
-#endif
-
+#endif /* defined(LITES) && defined(EXT2_OS_LITES) */
+#endif /* defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) */
+#endif /* defined(__GNU__) && defined(EXT2_OS_HURD) */
+#endif /* defined(__linux__) && defined(EXT2_OS_LINUX) */
+
/*
* Note we override the kernel include file's idea of what the default
* check interval (never) should be. It's a good idea to check at
}
}
#endif /* __GNU__ */
- goto exit;
+ goto errout;
}
#ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */
/* Validate the entry in case /etc/mtab is out of date */
#endif /* DEBUG */
retval = 0;
}
- goto exit;
+ goto errout;
}
if (file_rdev && (st_buf.st_dev != file_rdev)) {
#ifdef DEBUG
printf("Bogus entry in %s! (%s not mounted on %s)\n",
mtab_file, file, mnt->mnt_dir);
#endif /* DEBUG */
- goto exit;
+ goto errout;
}
#endif /* __GNU__ */
*mount_flags = EXT2_MF_MOUNTED;
(void) unlink(TEST_FILE);
}
retval = 0;
-exit:
+errout:
endmntent (f);
return retval;
}
#endif /* defined(MOUNTED) || defined(_PATH_MOUNTED) */
}
-#elif defined(HAVE_GETMNTINFO)
+#else
+#if defined(HAVE_GETMNTINFO)
static errcode_t check_getmntinfo(const char *file, int *mount_flags,
char *mtpt, int mtlen)
return 0;
}
#endif /* HAVE_GETMNTINFO */
+#endif /* HAVE_MNTENT_H */
/*
* Check to see if we're dealing with the swap device.
return check_getmntinfo(device, mount_flags, mtpt, mtlen);
#else
#ifdef __GNUC__
-#warning "Can't use getmntent or getmntinfo to check for mounted filesystems!"
+ #warning "Can't use getmntent or getmntinfo to check for mounted filesystems!"
#endif
*mount_flags = 0;
return 0;
/* Not all architectures define BUG() */
#ifndef BUG
- #define BUG() do { \
+#define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
* ((char *) 0) = 0; \
} while (0)
#define my_llseek lseek64
-#elif defined(HAVE_LLSEEK)
+#else
+#if defined(HAVE_LLSEEK)
#include <syscall.h>
#ifndef HAVE_LLSEEK_PROTOTYPE
#endif /* __alpha__ || __ia64__ */
#endif /* HAVE_LLSEEK */
+#endif /* defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE) */
ext2_loff_t ext2fs_llseek (int fd, ext2_loff_t offset, int origin)
{
};
#ifdef __TURBOC__
-#pragma argsused
+ #pragma argsused
#endif
static int lookup_proc(struct ext2_dir_entry *dirent,
int offset,
* Helper function for ext2fs_read_bb_inode()
*/
#ifdef __TURBOC__
-#pragma argsused
+ #pragma argsused
#endif
static int mark_bad_block(ext2_filsys fs, blk_t *block_nr,
e2_blkcnt_t blockcnt, blk_t ref_block,
static void test_dump_block(io_channel channel,
struct test_private_data *data,
- unsigned long block, void *buf)
+ unsigned long block, const void *buf)
{
const unsigned char *cp;
FILE *f = data->outfile;
for (i=0, cp = buf; i < channel->block_size; i++, cp++) {
cksum += *cp;
}
- fprintf(f, "Contents of block %d, checksum %08x: \n", block, cksum);
+ fprintf(f, "Contents of block %lu, checksum %08lu: \n", block, cksum);
for (i=0, cp = buf; i < channel->block_size; i++, cp++) {
if ((i % 16) == 0)
fprintf(f, "%04x: ", i);
+2003-07-06 Theodore Ts'o <tytso@mit.edu>
+
+ * badblocks.c: Fix gcc -Wall nitpicks (signed/unsigned type issues)
+
+ * blkid.c: Fix gcc -Wall nitpicks (missing #include <string.h>)
+
2003-05-21 Theodore Ts'o <tytso@mit.edu>
* mke2fs.c (PRS, set_fs_defaults): If the sector size of the
* Perform a read of a sequence of blocks; return the number of blocks
* successfully sequentially read.
*/
-static long do_read (int dev, char * buffer, int try, int block_size,
+static long do_read (int dev, unsigned char * buffer, int try, int block_size,
unsigned long current_block)
{
long got;
* Perform a write of a sequence of blocks; return the number of blocks
* successfully sequentially written.
*/
-static long do_write (int dev, char * buffer, int try, int block_size,
+static long do_write (int dev, unsigned char * buffer, int try, int block_size,
unsigned long current_block)
{
long got;
int block_size, unsigned long from_count,
unsigned long blocks_at_once)
{
- char * blkbuf;
+ unsigned char * blkbuf;
int try;
long got;
unsigned int bb_count = 0;
num_blocks = 0;
alarm(0);
if (s_flag || v_flag)
- fprintf(stderr, _(done_string));
+ fputs(done_string, stderr);
fflush (stderr);
free (blkbuf);
int block_size, unsigned long from_count,
unsigned long blocks_at_once)
{
- char * buffer;
+ unsigned char * buffer;
const unsigned long patterns[] = {0xaa, 0x55, 0xff, 0x00};
const unsigned long *pattern;
int nr_pattern, pat_idx;
num_blocks = 0;
alarm (0);
if (s_flag | v_flag)
- fprintf(stderr, _(done_string));
+ fputs(done_string, stderr);
flush_bufs();
if (s_flag | v_flag)
fprintf (stderr, _("Reading and comparing: "));
num_blocks = 0;
alarm (0);
if (s_flag | v_flag)
- fprintf(stderr, _(done_string));
+ fputs(done_string, stderr);
flush_bufs();
}
uncapture_terminate();
int block_size, unsigned long from_count,
unsigned long blocks_at_once)
{
- char *blkbuf, *save_ptr, *test_ptr, *read_ptr;
+ unsigned char *blkbuf, *save_ptr, *test_ptr, *read_ptr;
int try, i;
const unsigned long patterns[] = { ~0 };
const unsigned long *pattern;
jmp_buf terminate_env;
errcode_t errcode;
long buf_used;
- unsigned int bb_count;
+ unsigned int bb_count = 0;
errcode = ext2fs_badblocks_list_iterate_begin(bb_list,&bb_iter);
if (errcode) {
num_blocks = 0;
alarm(0);
if (s_flag || v_flag > 1)
- fprintf(stderr, _(done_string));
+ fputs(done_string, stderr);
flush_bufs();
}
break;
case 't':
if (t_flag + 1 > t_max) {
- long *t_patts_new;
+ unsigned long *t_patts_new;
t_patts_new = realloc(t_patts, t_max + T_INC);
if (!t_patts_new) {
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else