program - example of libgmime-1.90.6 use and new algorithm to test

Matthias Andree matthias.andree at gmx.de
Fri Dec 13 16:08:36 CET 2002


Scott Lenser <slenser at cs.cmu.edu> writes:

>   Included in this message is a program derived from an ancient
> version of bogofilter (version 0.7).  I realize this is an ancient
> version, but I had already made substantial changes that included some
> additional features but lost some features compared to the standard
> bogofilter releases before I realized bogofilter had been updated
> quite a bit.

It doesn't work with ISO-C++ compilers such as gcc 3.2, so I cannot
compile it, so I'll revert from glancing at the code. It looks as though
g_mime was pretty clear and not very invasive, so it might get my
preliminary approval after we've figured how to quelch ALL g_mime*
warnings and errors. On the down side, g_mime is HUGE, 256 k. I do
believe MIME fits in much less. We may want to stuff this libgmime
interface into a separate module so we have our internal API and can
exchange libgmime for something better that we run across later.

   text    data     bss     dec     hex filename
 183906   78472      28  262406   40106 /usr/local/lib/libgmime-2.0.so.1.90.7

Libraries must report problems through their API
(look at openssl for example) or maybe use exceptions when C++ libraries
(or other languages with official exceptions support), and not
out-of-band. OFFERING additional stderr or syslog is fine, but not by
default. Libraries must not get in the way, which glib, gmime and gtk+
do.

BTW, the other reason not to use gtk+ is that you're getting RSI -
repetitive strain syndrome aka. "tennis arm" (that's how we call it in
Germany from all the gory marshalling and connecting and callbacks.

Back on topic, you probably have an older version of gcc, presumably
2.95, that shipped with an incomplete or obsolete C++ standard
library. These are the essentials of the output (i. e. -Wall removed,
which gives tons of #pragma warnings).

g++ -g -O3  `gmime-config --cflags` -c -o bogofilter.o bogofilter.cc
In file included from /usr/include/g++/backward/strstream:51,
                 from bogofilter.cc:91:
/usr/include/g++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
bogofilter.cc:197: specializing `struct __gnu_cxx::hash<std::pair<_T1, _T2> >'
   in different namespace
/usr/include/g++/ext/stl_hash_fun.h:71:   from definition of `template<class
   _Key> struct __gnu_cxx::hash'
bogofilter.cc: In function `const char* create_class_file_name(const char*)':
bogofilter.cc:572: warning: address of local variable `class_filename' returned
make: *** [bogofilter.o] Fehler 1

-- 
Matthias Andree




More information about the bogofilter-dev mailing list