Openwrt/tools/genext2fs/patches/100-c99_scanf.patch
John Crispin b6fbe7bd5d tools: genext2fs: add support for blocksize != 1024
This patch series is extracted from
http://ftp.de.debian.org/debian/pool/main/g/genext2fs/genext2fs_1.4.1-4.debian.tar.gz

The patches are used in Debian for quite a long time, so I assume that
this is solid material. At least, my Ubuntu host fsck.ext4 does not bark :-)

The goal is to allow building filesystems with larger blocksizes instead of the
current default of 1k. This should improve performance and lifetime when the
filesystem is stored e.g. on a SD card (on Raspberry Pi/I2SE Duckbill for example)
which uses internal flash memory. Writing to flash memory is slow because writing
the data of one block results in erasing a whole erase block of the flash memory.
Thus it is preferable to align the filesystem block size on a flash device with
the erase blocksize, or at least bring it closer to the later one, to avoid
unnecessary write amplification.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

SVN-Revision: 40921
2014-06-02 12:43:46 +00:00

22 lines
727 B
Diff

commit 3b8ca0ce9a0b58287a780747c90c449bdebfe464
Author: Xavier Bestel <bestouff@users.sourceforge.net>
Date: Mon Jan 14 08:52:44 2008 +0000
removed use of %as is scanf (GNU conflicts with C99) by Giacomo Catenazzi <cate@debian.org>
diff --git a/genext2fs.c b/genext2fs.c
index 070b270..f0d797d 100644
--- a/genext2fs.c
+++ b/genext2fs.c
@@ -286,7 +286,9 @@ typedef unsigned int uint32;
// older solaris. Note that this is still not very portable, in that
// the return value cannot be trusted.
-#if SCANF_CAN_MALLOC
+#if 0 // SCANF_CAN_MALLOC
+// C99 define "a" for floating point, so you can have runtime surprise
+// according the library versions
# define SCANF_PREFIX "a"
# define SCANF_STRING(s) (&s)
#else