Re: [courier-users] [patch] fix duplicate definition of sqwebmail_content_charset in courier
Alessandro Vesely writes: On Mon 19/Sep/2016 13:58:28 +0200 Hanno Böck wrote: > > The variable sqwebmail_content_charset is defined twice, in sqwebmail.c > and gpg.c. One of them should be declared as extern. Isn't that the default? The C spec has sentences such as: If the declaration of an identifier for an object has file scope and no storage-class specifier, its linkage is external. https://www.securecoding.cert.org/confluence/display/c/DCL36-C. +Do+not+declare+an+identifier+with+conflicting+linkage+classifications You're probably right; still this is a bit messy, and should be fixed. pgps96MljTPZk.pgp Description: PGP signature -- ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] [patch] fix duplicate definition of sqwebmail_content_charset in courier
On Mon 19/Sep/2016 13:58:28 +0200 Hanno Böck wrote: > > The variable sqwebmail_content_charset is defined twice, in sqwebmail.c > and gpg.c. One of them should be declared as extern. Isn't that the default? The C spec has sentences such as: If the declaration of an identifier for an object has file scope and no storage-class specifier, its linkage is external. https://www.securecoding.cert.org/confluence/display/c/DCL36-C.+Do+not+declare+an+identifier+with+conflicting+linkage+classifications Ale -- ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] [patch] fix duplicate definition of sqwebmail_content_charset in courier
Hi, The variable sqwebmail_content_charset is defined twice, in sqwebmail.c and gpg.c. One of them should be declared as extern. By default gcc is lax on these things and allows duplicate global definitions. However it is not correct and gcc can be switched to a more strict mode with the flag -fno-common. See attached patch, it'll declare the variable as extern in gpg.c. Please apply. -- Hanno Böck https://hboeck.de/ mail/jabber: ha...@hboeck.de GPG: FE73757FA60E4E21B937579FA5880072BBB51E42 --- a/libs/sqwebmail/gpg.c 2015-02-27 20:13:32.0 +0100 +++ b/libs/sqwebmail/gpg.c 2016-09-19 13:54:15.389533196 +0200 @@ -36,7 +36,7 @@ extern void output_scriptptrget(); extern void print_attrencodedlen(const char *, size_t, int, FILE *); extern void print_safe(const char *); -const char *sqwebmail_content_charset; +extern const char *sqwebmail_content_charset; static char gpgerrbuf[1024]; pgpsE5XGTiLUJ.pgp Description: OpenPGP digital signature -- ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users