summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <jbj>2002-06-15 19:44:26 +0000
committerjbj <jbj>2002-06-15 19:44:26 +0000
commit9cc5d50d2d29a36c72176e02cae3524a8f1c711e (patch)
tree07a01c814b154519d887808550d287cd92e3ac2f
parent6889b8b9f57ca04e56016b978b45327bcb8c8612 (diff)
downloadlibpopt-9cc5d50d2d29a36c72176e02cae3524a8f1c711e.tar.gz
- beecrypt: merge changes from beecrypt-2.3.0.
- beecrypt: merge doxygen markup with rpmapi doco. - beecrypt: revert cpu/arch compile option mixup (#66752).
-rw-r--r--.lclintrc69
-rw-r--r--Makefile.am2
-rw-r--r--po/cs.po2
-rw-r--r--po/da.po2
-rw-r--r--po/de.po2
-rw-r--r--po/es.po2
-rw-r--r--po/eu_ES.po2
-rw-r--r--po/fi.po2
-rw-r--r--po/fr.po2
-rw-r--r--po/gl.po2
-rw-r--r--po/hu.po2
-rw-r--r--po/id.po2
-rw-r--r--po/is.po2
-rw-r--r--po/it.po2
-rw-r--r--po/ja.po2
-rw-r--r--po/ko.po2
-rw-r--r--po/no.po2
-rw-r--r--po/pl.po2
-rw-r--r--po/popt.pot2
-rw-r--r--po/pt.po2
-rw-r--r--po/pt_BR.po2
-rw-r--r--po/ro.po2
-rw-r--r--po/ru.po2
-rw-r--r--po/sk.po2
-rw-r--r--po/sl.po2
-rw-r--r--po/sr.po2
-rw-r--r--po/sv.po2
-rw-r--r--po/tr.po2
-rw-r--r--po/uk.po2
-rw-r--r--po/wa.po2
-rw-r--r--po/zh.po2
-rw-r--r--po/zh_CN.GB2312.po2
-rw-r--r--popt.c9
-rw-r--r--popt.h22
-rw-r--r--poptint.h52
-rw-r--r--test1.c120
36 files changed, 204 insertions, 130 deletions
diff --git a/.lclintrc b/.lclintrc
index 6a85d82..488dbf5 100644
--- a/.lclintrc
+++ b/.lclintrc
@@ -1,6 +1,6 @@
-I. -DHAVE_CONFIG_H -D_GNU_SOURCE
-+partial
+#+partial
+forcehints
-warnunixlib
@@ -12,54 +12,37 @@
+strict # lclint level
-# --- +partial artifacts
--declundef
--exportheadervar
--exportlocal
+# --- in progress
+#+bounds # 56
+#+boundswrite # 40
--enummemuse
--fcnuse
--typeuse
--varuse
+# --- +partial artifacts
+-exportlocal # 14
+-fcnuse # 7
# --- not-yet at strict level
--bitwisesigned # pita
--elseifcomplete # 95 occurences
--exportconst # 839 occurences
--exportfcn
--exporttype
--exportvar
--fielduse # 1 occurence <bits/sigset.h>
--forblock # tedious
--ifblock # tedious
--incondefs # <bits/{ipc,pthreadtypes}.h> heartburn
--matchfields # <bits/ipc.h> heartburn
--namechecks # tedious ANSI compliance checks
--numenummembers 1024 # RPMTAG has 138 members
--numstructfields 256 # Java jni.h has 229 fields
--ptrarith # tedious
+-bitwisesigned # 75
+-elseifcomplete # 18
+-exportfcn # 25
+-globs # 12 <ctype.h>
+-ifblock # 202
+-incondefs # 37 <bits/{ipc,pthreadtypes}.h> heartburn
+-namechecks # 206
+-ptrarith # 43
--compdestroy
--mustdefine
--shiftimplementation
-#-shiftnegative
+-mustdefine # 10
+-shiftimplementation # 120
--strictops
--strictusereleased
--stringliterallen 4096 # redhat*PubKey's are big
--whileblock # tedious
+-strictops # 16
+-whileblock # 10
# --- not-yet at checks level
--ansi-reserved
-+enumint
--mustfree
--predboolptr
--usedef
+-mustfree # 52
+-predboolptr # 62
+-usedef # 1
# --- not-yet at standard level
--boolops
--predboolint
-+boolint
-+charint
-+ignorequals
-+matchanyintegral
+-boolops # 112
+-predboolint # 30
++charint # 3
++ignorequals # 13
diff --git a/Makefile.am b/Makefile.am
index af8113a..25dcf50 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,7 @@ sources:
.PHONY: lclint
lclint:
- lclint ${DEFS} ${INCLUDES} ${libpopt_la_SOURCES}
+ lclint ${DEFS} ${INCLUDES} test1.c ${libpopt_la_SOURCES}
CVSTAG = $(PACKAGE)-$(subst .,_,$(VERSION))
diff --git a/po/cs.po b/po/cs.po
index b42504b..1de2fdf 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-07-24 00:03+0100\n"
"Last-Translator: Milan Kerslager <kerslage@linux.cz>\n"
"Language-Team: Czech <cs@li.org>\n"
diff --git a/po/da.po b/po/da.po
index fc165e3..b0ea5a5 100644
--- a/po/da.po
+++ b/po/da.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: Sun Jan 21 2001 04:30:32+0200\n"
"Last-Translator: Martin Hansen <mah@k64.dk>\n"
"Language-Team: Dansk <dansk@klid.dk>\n"
diff --git a/po/de.po b/po/de.po
index 203c754..de352bc 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/es.po b/po/es.po
index 625a116..17e65d8 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Leandro Lucarella <luca@linuxmendoza.org.ar>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/eu_ES.po b/po/eu_ES.po
index 203c754..de352bc 100644
--- a/po/eu_ES.po
+++ b/po/eu_ES.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/fi.po b/po/fi.po
index 203c754..de352bc 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/fr.po b/po/fr.po
index 203c754..de352bc 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/gl.po b/po/gl.po
index dac7820..971fffe 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-01-17 01:01+0100\n"
"Last-Translator: Jesús Bravo Álvarez <jba@pobox.com>\n"
"Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
diff --git a/po/hu.po b/po/hu.po
index e495837..61ffcf7 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2000-08-03 23:26+0200\n"
"Last-Translator: László Németh <nemeth@qwertynet.hu>\n"
"Language-Team: Hungarian\n"
diff --git a/po/id.po b/po/id.po
index 203c754..de352bc 100644
--- a/po/id.po
+++ b/po/id.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/is.po b/po/is.po
index 44bf3dd..df85fc3 100644
--- a/po/is.po
+++ b/po/is.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-06-08 01:35+0000\n"
"Last-Translator: Richard Allen <ra@hp.is>\n"
"Language-Team: is <kde-isl@mmedia.is>\n"
diff --git a/po/it.po b/po/it.po
index 203c754..de352bc 100644
--- a/po/it.po
+++ b/po/it.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/ja.po b/po/ja.po
index 203c754..de352bc 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/ko.po b/po/ko.po
index 1e0b9e7..cd2c857 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-09-06 20:06+0900\n"
"Last-Translator: Jong-Hoon Ryu <redhat4u@netian.com>\n"
"Language-Team: GNU Translation project <ko@li.org>\n"
diff --git a/po/no.po b/po/no.po
index c9aabe3..5567063 100644
--- a/po/no.po
+++ b/po/no.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-06-27 11:05+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@online.no>\n"
"Language-Team: Norwegian <no@li.org>\n"
diff --git a/po/pl.po b/po/pl.po
index 203c754..de352bc 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/popt.pot b/po/popt.pot
index a8952cb..9d5a999 100644
--- a/po/popt.pot
+++ b/po/popt.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/pt.po b/po/pt.po
index 48660fb..b88ba7b 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2002-02-13 18:32+0000\n"
"Last-Translator: Pedro Morais <morais@kde.org>\n"
"Language-Team: pt <morais@kde.org>\n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 203c754..de352bc 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/ro.po b/po/ro.po
index 61587e0..d4ee0c2 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2000-06-14 23:23+EST\n"
"Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
"Language-Team: Romanian <ro@li.org>\n"
diff --git a/po/ru.po b/po/ru.po
index 5ff1527..64f667f 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-07-05 21:00-0500\n"
"Last-Translator: Eugene Kanter <eugene@blackcatlinux.com>\n"
"Language-Team: Black Cat Linux Team <blackcat-support@blackcatlinux.com>\n"
diff --git a/po/sk.po b/po/sk.po
index 2f7c956..622680d 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 1999-08-04 21:40+0200\n"
"Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
diff --git a/po/sl.po b/po/sl.po
index 5d462f4..b2ddf92 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2000-09-05 12:30+0200\n"
"Last-Translator: Roman Maurer <roman.maurer@hermes.si>\n"
"Language-Team: Slovenian <sl@li.org>\n"
diff --git a/po/sr.po b/po/sr.po
index 203c754..de352bc 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/sv.po b/po/sv.po
index 2eb9a2d..d971640 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2001-07-12 22:26+0100\n"
"Last-Translator: Christian Rose <menthos@menthos.com>\n"
"Language-Team: Swedish <sv@li.org>\n"
diff --git a/po/tr.po b/po/tr.po
index 7e91800..60df608 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 2000-02-11 13:01+0200\n"
"Last-Translator: Nilgun Belma Buguner <nilgun@technologist.com>\n"
"Language-Team: Turkish <tr@li.org>\n"
diff --git a/po/uk.po b/po/uk.po
index 83f8bdc..1034411 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 1999-09-30 16:54+0200\n"
"Last-Translator: Yuri Syrota <rasta@renome.rovno.ua>\n"
"Language-Team: Ukrainian <uk@li.org>\n"
diff --git a/po/wa.po b/po/wa.po
index 0ed342d..e725750 100644
--- a/po/wa.po
+++ b/po/wa.po
@@ -9,7 +9,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 1999-03-18 23:11+0100\n"
"Last-Translator: Nobody yet\n"
"Language-Team: walon <linux-wa@chanae.alphanet.ch>\n"
diff --git a/po/zh.po b/po/zh.po
index 203c754..de352bc 100644
--- a/po/zh.po
+++ b/po/zh.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/po/zh_CN.GB2312.po b/po/zh_CN.GB2312.po
index 39f3475..3262546 100644
--- a/po/zh_CN.GB2312.po
+++ b/po/zh_CN.GB2312.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-05-06 15:34-0400\n"
+"POT-Creation-Date: 2002-06-15 10:10-0400\n"
"PO-Revision-Date: 1999-11-11 05:04+0800\n"
"Last-Translator: Dillion Chen <dillon.chen@turbolinux.com.cn>\n"
"Language-Team: TLDN\n"
diff --git a/popt.c b/popt.c
index 962f973..16bdbff 100644
--- a/popt.c
+++ b/popt.c
@@ -222,10 +222,11 @@ void poptResetContext(poptContext con)
con->doExec = NULL;
if (con->finalArgv != NULL)
- for (i = 0; i < con->finalArgvCount; i++)
+ for (i = 0; i < con->finalArgvCount; i++) {
/*@-unqualifiedtrans@*/ /* FIX: typedef double indirection. */
con->finalArgv[i] = _free(con->finalArgv[i]);
/*@=unqualifiedtrans@*/
+ }
con->finalArgvCount = 0;
con->arg_strip = PBM_FREE(con->arg_strip);
@@ -296,7 +297,7 @@ static int handleExec(/*@special@*/ poptContext con,
/* Only one of longName, shortName may be set at a time */
static int handleAlias(/*@special@*/ poptContext con,
/*@null@*/ const char * longName, char shortName,
- /*@keep@*/ /*@null@*/ const char * nextCharArg)
+ /*@exposed@*/ /*@null@*/ const char * nextCharArg)
/*@uses con->aliases, con->numAliases, con->optionStack, con->os,
con->os->currAlias, con->os->currAlias->option.longName @*/
/*@modifies con @*/
@@ -346,6 +347,7 @@ static int handleAlias(/*@special@*/ poptContext con,
return (rc ? rc : 1);
}
+/*@-bounds -boundswrite @*/
static int execCommand(poptContext con)
/*@*/
{
@@ -417,6 +419,7 @@ static int execCommand(poptContext con)
if (argv[0] == NULL)
return POPT_ERROR_NOARG;
+
#ifdef MYDEBUG
{ const char ** avp;
fprintf(stderr, "==> execvp(%s) argv[%d]:", argv[0], argc);
@@ -427,8 +430,10 @@ static int execCommand(poptContext con)
#endif
rc = execvp(argv[0], (char *const *)argv);
+
return POPT_ERROR_ERRNO;
}
+/*@=bounds =boundswrite @*/
/*@observer@*/ /*@null@*/ static const struct poptOption *
findOption(const struct poptOption * opt, /*@null@*/ const char * longName,
diff --git a/popt.h b/popt.h
index 495cc99..60d27e6 100644
--- a/popt.h
+++ b/popt.h
@@ -134,11 +134,13 @@ struct poptAlias {
/** \ingroup popt
* A popt alias or exec argument for poptAddItem().
*/
+/*@-exporttype@*/
typedef struct poptItem_s {
struct poptOption option; /*!< alias/exec name(s) and description. */
int argc; /*!< (alias) no. of args. */
/*@owned@*/ const char ** argv; /*!< (alias) args, must be free()able. */
} * poptItem;
+/*@=exporttype@*/
/** \ingroup popt
* \name Auto-generated help/usage
@@ -148,16 +150,20 @@ typedef struct poptItem_s {
/**
* Empty table marker to enable displaying popt alias/exec options.
*/
+/*@-exportvar@*/
/*@observer@*/ /*@checked@*/
extern struct poptOption poptAliasOptions[];
+/*@=exportvar@*/
#define POPT_AUTOALIAS { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptAliasOptions, \
0, "Options implemented via popt alias/exec:", NULL },
/**
* Auto help table options.
*/
+/*@-exportvar@*/
/*@observer@*/ /*@checked@*/
extern struct poptOption poptHelpOptions[];
+/*@=exportvar@*/
#define POPT_AUTOHELP { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptHelpOptions, \
0, "Help options:", NULL },
@@ -166,19 +172,25 @@ extern struct poptOption poptHelpOptions[];
/** \ingroup popt
*/
+/*@-exporttype@*/
typedef /*@abstract@*/ struct poptContext_s * poptContext;
+/*@=exporttype@*/
/** \ingroup popt
*/
#ifndef __cplusplus
-/*@-typeuse@*/
+/*@-exporttype -typeuse@*/
typedef struct poptOption * poptOption;
-/*@=typeuse@*/
+/*@=exporttype =typeuse@*/
#endif
-enum poptCallbackReason { POPT_CALLBACK_REASON_PRE,
- POPT_CALLBACK_REASON_POST,
- POPT_CALLBACK_REASON_OPTION };
+/*@-exportconst@*/
+enum poptCallbackReason {
+ POPT_CALLBACK_REASON_PRE = 0,
+ POPT_CALLBACK_REASON_POST = 1,
+ POPT_CALLBACK_REASON_OPTION = 2
+};
+/*@=exportconst@*/
#ifdef __cplusplus
extern "C" {
diff --git a/poptint.h b/poptint.h
index 30172fe..a4f9147 100644
--- a/poptint.h
+++ b/poptint.h
@@ -23,13 +23,17 @@ _free(/*@only@*/ /*@null@*/ const void * p)
}
/* Bit mask macros. */
+/*@-exporttype@*/
typedef unsigned int __pbm_bits;
+/*@=exporttype@*/
#define __PBM_NBITS (8 * sizeof (__pbm_bits))
#define __PBM_IX(d) ((d) / __PBM_NBITS)
#define __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS))
+/*@-exporttype@*/
typedef struct {
__pbm_bits bits[1];
} pbm_set;
+/*@=exporttype@*/
#define __PBM_BITS(set) ((set)->bits)
#define PBM_ALLOC(d) calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits))
@@ -40,37 +44,53 @@ typedef struct {
struct optionStackEntry {
int argc;
-/*@only@*/ /*@null@*/ const char ** argv;
-/*@only@*/ /*@null@*/ pbm_set * argb;
+/*@only@*/ /*@null@*/
+ const char ** argv;
+/*@only@*/ /*@null@*/
+ pbm_set * argb;
int next;
-/*@only@*/ /*@null@*/ const char * nextArg;
-/*@keep@*/ /*@null@*/ const char * nextCharArg;
-/*@dependent@*/ /*@null@*/ poptItem currAlias;
+/*@only@*/ /*@null@*/
+ const char * nextArg;
+/*@observer@*/ /*@null@*/
+ const char * nextCharArg;
+/*@dependent@*/ /*@null@*/
+ poptItem currAlias;
int stuffed;
};
struct poptContext_s {
struct optionStackEntry optionStack[POPT_OPTION_DEPTH];
-/*@dependent@*/ struct optionStackEntry * os;
-/*@owned@*/ /*@null@*/ const char ** leftovers;
+/*@dependent@*/
+ struct optionStackEntry * os;
+/*@owned@*/ /*@null@*/
+ const char ** leftovers;
int numLeftovers;
int nextLeftover;
-/*@keep@*/ const struct poptOption * options;
+/*@keep@*/
+ const struct poptOption * options;
int restLeftover;
-/*@only@*/ /*@null@*/ const char * appName;
-/*@only@*/ /*@null@*/ poptItem aliases;
+/*@only@*/ /*@null@*/
+ const char * appName;
+/*@only@*/ /*@null@*/
+ poptItem aliases;
int numAliases;
int flags;
-/*@owned@*/ /*@null@*/ poptItem execs;
+/*@owned@*/ /*@null@*/
+ poptItem execs;
int numExecs;
-/*@only@*/ /*@null@*/ const char ** finalArgv;
+/*@only@*/ /*@null@*/
+ const char ** finalArgv;
int finalArgvCount;
int finalArgvAlloced;
-/*@dependent@*/ /*@null@*/ poptItem doExec;
-/*@only@*/ const char * execPath;
+/*@dependent@*/ /*@null@*/
+ poptItem doExec;
+/*@only@*/
+ const char * execPath;
int execAbsolute;
-/*@only@*/ const char * otherHelp;
-/*@null@*/ pbm_set * arg_strip;
+/*@only@*/
+ const char * otherHelp;
+/*@null@*/
+ pbm_set * arg_strip;
};
#ifdef HAVE_LIBINTL_H
diff --git a/test1.c b/test1.c
index ca5b3a6..d1bbc47 100644
--- a/test1.c
+++ b/test1.c
@@ -4,43 +4,71 @@
#include "system.h"
+/*@unchecked@*/
static int pass2 = 0;
-static void option_callback(poptContext con, enum poptCallbackReason reason,
- const struct poptOption * opt,
- char * arg, void * data) {
+static void option_callback(/*@unused@*/ poptContext con,
+ /*@unused@*/ enum poptCallbackReason reason,
+ const struct poptOption * opt,
+ char * arg, void * data)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/
+{
if (pass2)
fprintf(stdout, "callback: %c %s %s ", opt->val, (char *) data, arg);
}
-int arg1 = 0;
-char * arg2 = "(none)";
-int arg3 = 0;
-int inc = 0;
-int shortopt = 0;
-
-int aVal = 141421;
-int bVal = 141421;
-int aFlag = 0;
-int bFlag = 0;
-
-int aInt = 271828;
-int bInt = 271828;
-long aLong = 738905609L;
-long bLong = 738905609L;
-float aFloat = 3.1415926535;
-float bFloat = 3.1415926535;
-double aDouble = 9.86960440108935861883;
-double bDouble = 9.86960440108935861883;
-char * oStr = (char *) -1;
-int singleDash = 0;
-
-char * lStr = "This tests default strings and exceeds the ... limit. "
+/*@unchecked@*/
+static int arg1 = 0;
+/*@unchecked@*/ /*@observer@*/
+static char * arg2 = "(none)";
+/*@unchecked@*/
+static int arg3 = 0;
+/*@unchecked@*/
+static int inc = 0;
+/*@unchecked@*/
+static int shortopt = 0;
+
+/*@unchecked@*/
+static int aVal = 141421;
+/*@unchecked@*/
+static int bVal = 141421;
+/*@unchecked@*/
+static int aFlag = 0;
+/*@unchecked@*/
+static int bFlag = 0;
+
+/*@unchecked@*/
+static int aInt = 271828;
+/*@unchecked@*/
+static int bInt = 271828;
+/*@unchecked@*/
+static long aLong = 738905609L;
+/*@unchecked@*/
+static long bLong = 738905609L;
+/*@unchecked@*/
+static float aFloat = 3.1415926535;
+/*@unchecked@*/
+static float bFloat = 3.1415926535;
+/*@unchecked@*/
+static double aDouble = 9.86960440108935861883;
+/*@unchecked@*/
+static double bDouble = 9.86960440108935861883;
+/*@unchecked@*/ /*@null@*/
+static char * oStr = (char *) -1;
+/*@unchecked@*/
+static int singleDash = 0;
+
+/*@unchecked@*/ /*@observer@*/
+static char * lStr =
+"This tests default strings and exceeds the ... limit. "
"123456789+123456789+123456789+123456789+123456789+ "
"123456789+123456789+123456789+123456789+123456789+ "
"123456789+123456789+123456789+123456789+123456789+ "
"123456789+123456789+123456789+123456789+123456789+ ";
-char * nStr = NULL;
+/*@unchecked@*/ /*@null@*/
+static char * nStr = NULL;
+/*@unchecked@*/
static struct poptOption moreCallbackArgs[] = {
{ NULL, '\0', POPT_ARG_CALLBACK|POPT_CBFLAG_INC_DATA,
(void *)option_callback, 0,
@@ -50,8 +78,10 @@ static struct poptOption moreCallbackArgs[] = {
POPT_TABLEEND
};
+/*@unchecked@*/
static struct poptOption callbackArgs[] = {
- { NULL, '\0', POPT_ARG_CALLBACK, (void *)option_callback, 0, "sampledata" },
+ { NULL, '\0', POPT_ARG_CALLBACK, (void *)option_callback, 0,
+ "sampledata", NULL },
{ "cb", 'c', POPT_ARG_STRING, NULL, 'c',
"Test argument callbacks", NULL },
{ "longopt", '\0', 0, NULL, 'l',
@@ -59,13 +89,16 @@ static struct poptOption callbackArgs[] = {
POPT_TABLEEND
};
+/*@unchecked@*/
static struct poptOption moreArgs[] = {
- { "inc", 'I', 0, &inc, 0, "An included argument" },
+ { "inc", 'I', 0, &inc, 0, "An included argument", NULL },
POPT_TABLEEND
};
+/*@unchecked@*/
static struct poptOption options[] = {
- { NULL, '\0', POPT_ARG_INCLUDE_TABLE, &moreCallbackArgs, 0, "arg for cb2" },
+ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, &moreCallbackArgs, 0,
+ "arg for cb2", NULL },
{ "arg1", '\0', 0, &arg1, 0, "First argument with a really long"
" description. After all, we have to test argument help"
" wrapping somehow, right?", NULL },
@@ -114,6 +147,12 @@ static struct poptOption options[] = {
};
static void resetVars(void)
+ /*@globals arg1, arg2, arg3, inc, shortopt,
+ aVal, aFlag, aInt, aLong, aFloat, aDouble,
+ oStr, singleDash, pass2 @*/
+ /*@modifies arg1, arg2, arg3, inc, shortopt,
+ aVal, aFlag, aInt, aLong, aFloat, aDouble,
+ oStr, singleDash, pass2 @*/
{
arg1 = 0;
arg2 = "(none)";
@@ -135,7 +174,10 @@ static void resetVars(void)
pass2 = 0;
}
-int main(int argc, const char ** argv) {
+int main(int argc, const char ** argv)
+ /*@globals pass2, fileSystem @*/
+ /*@modifies pass2, fileSystem @*/
+{
int rc;
int ec = 0;
poptContext optCon;
@@ -144,19 +186,27 @@ int main(int argc, const char ** argv) {
int usage = 0;
#if HAVE_MCHECK_H && HAVE_MTRACE
+ /*@-moduncon -noeffectuncon@*/
mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
+ /*@=moduncon =noeffectuncon@*/
#endif
+/*@-modobserver@*/
resetVars();
+/*@=modobserver@*/
+/*@-temptrans@*/
optCon = poptGetContext("test1", argc, argv, options, 0);
- poptReadConfigFile(optCon, "./test-poptrc");
+/*@=temptrans@*/
+ (void) poptReadConfigFile(optCon, "./test-poptrc");
#if 1
while ((rc = poptGetNextOpt(optCon)) > 0) /* Read all the options ... */
- ;
+ {};
poptResetContext(optCon); /* ... and then start over. */
+/*@-modobserver@*/
resetVars();
+/*@=modobserver@*/
#endif
pass2 = 1;
@@ -193,10 +243,12 @@ int main(int argc, const char ** argv) {
fprintf(stdout, " aInt: %d", aInt);
if (aLong != bLong)
fprintf(stdout, " aLong: %ld", aLong);
+/*@-realcompare@*/
if (aFloat != bFloat)
fprintf(stdout, " aFloat: %g", aFloat);
if (aDouble != bDouble)
fprintf(stdout, " aDouble: %g", aDouble);
+/*@=realcompare@*/
if (oStr != (char *)-1)
fprintf(stdout, " oStr: %s", (oStr ? oStr : "(none)"));
if (singleDash)
@@ -216,7 +268,9 @@ int main(int argc, const char ** argv) {
exit:
optCon = poptFreeContext(optCon);
#if HAVE_MCHECK_H && HAVE_MTRACE
+ /*@-moduncon -noeffectuncon@*/
muntrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
+ /*@=moduncon =noeffectuncon@*/
#endif
return ec;
}