[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Confuse-devel] CFG_SIMPLE_INT on 64bit machine
From: |
Carlo Marcelo Arenas Belon |
Subject: |
Re: [Confuse-devel] CFG_SIMPLE_INT on 64bit machine |
Date: |
Sun, 25 Apr 2010 06:48:41 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, Apr 24, 2010 at 04:09:53PM +0200, Martin H?mberg wrote:
>
> If you consider this as a bug, then please fix it. If not, then it is
> worth mentioning on your website.
agree this should be on some FAQ but a google search for CFG_SIMPLE_INT
still shows the following warning as the first link :
http://www.mail-archive.com/address@hidden/msg00084.html
the changes required to use CFG_INT instead for your bug program and as
recommended in the tutorial/examples are inlined below and are minimal :
http://www.nongnu.org/confuse/tutorial-html/ar01s02.html
http://git.savannah.gnu.org/cgit/confuse.git/tree/examples/simple.c
Carlo
PS. throwing a warning when CFG_SIMPLE_INT is used in this buggy context
might be better.
--- bug.c 2010-04-25 06:32:11.000000000 +0000
+++ bug2.c 2010-04-25 06:37:46.000000000 +0000
@@ -4,7 +4,7 @@
static int a[2] = {0, 4};
static cfg_opt_t opts[] = {
- CFG_SIMPLE_INT("b", &a[0]),
+ CFG_INT("b", 0, CFGF_NONE),
CFG_END()
};
@@ -19,6 +19,7 @@
printf("Couldn't read config.txt. Goodbye.\n");
return 1;
}
+ a[0] = cfg_getint(cfg, "b");
printf("2. a=%d b=%d\n", a[0], a[1]);