Commit Graph

40 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Nicolas Williams
a222521e68 64-bit build fixes for ASN.1 compiler 64-bit integer support 2011-12-13 13:03:57 -06:00
Nicolas Williams
19d378f44d Add 64-bit integer support to ASN.1 compiler
ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
    on whether the constraint ranges include numbers that cannot be
    represented in 32-bit ints and whether they include negative
    numbers.

    Template backend support included.  check-template is now built with
    --template, so we know we're testing it.

    Tests included.
2011-12-12 20:01:20 -06:00
Love Hörnquist Åstrand
b8ddbe73c4 quite down clang analyzer warnings for the generate asn1 code 2011-06-14 22:29:49 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Asanka Herath
3d83131be8 Export and calling convention annotation for lib/asn1 2010-08-20 13:14:10 -04:00
Asanka Herath
ac26475f2c Roll back asn1/gen_encode.c type safety patch 2010-08-20 13:06:57 -04:00
Asanka Herath
d25d9476b7 Type safety and variable initialization in ASN.1 generated code 2010-08-20 13:03:33 -04:00
Love Hornquist Astrand
e65154c6db catch error from as.*printf 2010-05-30 14:48:48 -07:00
Love Hornquist Astrand
b939943b07 first stange of asn1 table driven compiler 2009-11-21 10:24:56 -08:00
Love Hornquist Astrand
4d06f484ec implement TeletexString 2009-09-30 00:48:18 -07:00
Love Hörnquist Åstrand
0e6b5c5c22 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25232 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-28 01:17:17 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
731d6e6df8 REVERT: add and use der_{malloc,free}
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22429 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-13 10:25:50 +00:00
Love Hörnquist Åstrand
9af9863be1 add and use der_{malloc,free}
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22426 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-13 09:54:32 +00:00
Love Hörnquist Åstrand
6304d68d16 try to avoid aliasing of pointers enum {} vs int
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21503 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-12 11:57:19 +00:00
Love Hörnquist Åstrand
50cd4e0c1c Paranoia check in buffer overun in output function.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21361 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-27 08:38:13 +00:00
Love Hörnquist Åstrand
5342643f04 update (c)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19572 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-29 17:30:32 +00:00
Love Hörnquist Åstrand
682c7deda6 Named bit strings have this horrible, disgusting, compress bits until
they are no longer really there but stuff in an initial octet anyway
encoding scheme. Try to get it right and calculate the initial octet
runtime instead of compiletime.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19570 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-29 17:29:13 +00:00
Love Hörnquist Åstrand
983b89b811 Add VisibleString parsing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19539 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-28 17:15:05 +00:00
Love Hörnquist Åstrand
394907625f Change name of oldret for each instance its used to avoid shadow
warning. From: Stefan Metzmacher <metze@samba.org>.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15962 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-23 11:52:16 +00:00
Love Hörnquist Åstrand
ab69af8c30 (TChoice): add () to make sure variable expression is evaluated correctly
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15646 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-13 10:40:23 +00:00
Love Hörnquist Åstrand
b838707d0e Commit much improved ASN.1 compiler from joda-choice-branch.
Highlighs for the compiler is support for CHOICE and in general better
support for tags. This compiler support most of what is needed for
PK-INIT, LDAP, X.509, PKCS-12 and many other protocols.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15617 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-12 06:27:42 +00:00
Love Hörnquist Åstrand
53ac3a20b2 make scope variables unique to avoid shadow warnings
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15614 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-10 05:13:09 +00:00
Love Hörnquist Åstrand
8e78ed6e48 prefix Der_class with ASN1_C_ to avoid problems with system headerfiles that pollute the name space
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15255 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-29 14:23:01 +00:00
Love Hörnquist Åstrand
8b8bcb8c9b add boolan support
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12944 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-10-03 00:28:29 +00:00
Love Hörnquist Åstrand
bd85856ef6 -= add parser/generate glue for UTF8String and NULL
(DER primitive encode/decode functions missing)
- handle parsing of DEFAULT and, ...


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12311 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-05-20 18:42:10 +00:00
Assar Westerlund
2bcae56ac3 add ENUMERATED and OBJECT IDENTIFIER
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10741 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-09-25 13:39:27 +00:00
Johan Danielsson
90c3ac7191 support for distinguished value integers
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8396 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-06-19 15:19:23 +00:00
Assar Westerlund
0c46c78bd1 (encode_type, generate_type_encode): add TUInteger
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8132 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-04-06 17:23:32 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Assar Westerlund
a74d27d3d7 const-ize
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7130 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-10-10 04:55:28 +00:00
Johan Danielsson
ca8b03f428 Hack to avoid `unused variable'.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4577 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-03-16 21:26:15 +00:00
Johan Danielsson
abb2cf3533 Improve formatting of headerfile.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2482 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-20 01:00:18 +00:00
Johan Danielsson
5a32a5c8e7 Add copyright notice.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2389 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-16 21:40:05 +00:00
Assar Westerlund
c1439d2cd8 changed asn1_locl.h to gen_locl.h and der_locl.h
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2328 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-15 20:02:05 +00:00
Assar Westerlund
5b1f9fc01c Use err' and asprintf'
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2272 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-14 11:38:28 +00:00
Johan Danielsson
372881f5ef Now all decode_* and encode_* functions now take a final size_t*
argument, that they return the size in. Return values are zero for
success, and anything else (such as some ASN1_* constant) for error.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1951 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-07-01 23:52:30 +00:00
Johan Danielsson
a510e42b08 Split of gen.c
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1447 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-03-17 10:33:57 +00:00