    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Members' Experiences</title>
        <link>https://members.accu.org/index.php/articles/753</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 11, #1 - Nov 1998</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c134/">111</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Members' Experiences</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 November 1998 13:15:28 +00:00 or Tue, 03 November 1998 13:15:28 +00:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="section" lang="en">
<div class="titlepage">
<div>
<h2><a name="d0e20" id="d0e20"></a>Ming GNU C++
and Programmer's File Editor</h2>
</div>
<div>
<h3>Silas S. Brown <tt class="email">&lt;<a href=
"mailto:ssb22@hermes.cam.ac.uk">ssb22@hermes.cam.ac.uk</a>&gt;</tt></h3>
</div>
</div>
<p class="c2"><span class="remark">This contribution from Silas
keeps this column limping along. I would love to share more of my
experiences with you but time does not permit. What's your
excuse?</span></p>
<p>Not everybody has heard of the Free Software Foundation, but, if
you have a good Internet connection, then it is worth knowing about
these people. GNU's website is <a href="http://www.gnu.org/"
target="_top">http://www.gnu.org/</a> and contains a lot of
information about their philosophy and so on (which there would be
little point in duplicating here), but this is not the quickest way
of finding ports to platforms other than Unix. Searching the Web
(e.g. with <a href="http://www.metacrawler.com/" target=
"_top">http://www.metacrawler.com/</a>) tends to be better for
this, but, of course, make sure that what you end up with looks
vaguely &quot;official&quot; and that you virus-check it.</p>
<p>There are two main implementations of a 32-bit Windows C and C++
compiler: Cygnus and Ming. Cygnus attempts to emulate a Unix
environment, whereas Ming is a &quot;minimalist&quot; implementation with
32-bit Windows API headers, for compiling native Win32
applications. Unfortunately, it is difficult to install both
without the two installations interfering with each other (you have
to do a lot of environment variable setting). I installed Ming,
because I could not get anything to work with Cygnus (I'm not that
much a &quot;Unix person&quot;).</p>
<p>I had various annoyances and things not working (like having to
re-implement <tt class="filename">string.h</tt>, and g++ and
streams not working), but I won't go into those because I later
found that downloading a newer version fixed them. The only serious
problem in the version I now have is a problem with file positions
in text mode (<tt class="function">fgetpos</tt>/<tt class=
"function">fsetpos</tt> and <tt class=
"function">ftell</tt>/<tt class="function">fseek</tt> doesn't work
properly) that I had to patch around in my code. Also I had an
&quot;ANSI C++ forbids implicit conversion from `<tt class="type">void
*</tt>' in assignment&quot; warning whenever I tried to use <tt class=
"filename">stdargs.h</tt> (like Francis, I like my code to compile
without warnings).</p>
<p>In case anyone wants to know, the problem with <tt class=
"filename">stdargs.h</tt> (which is a mistake that many programmers
can make so I'll describe it now) is using '<tt class=
"literal">typedef</tt>' as an alternative to '<tt class=
"literal">#define</tt>' without considering the differences.
Somebody defined a <tt class="literal">__gnuc_va_list</tt> type and
some macros to process it, then later on put a '<tt class=
"literal">typedef __gnuc_va_list va_list</tt>' and assumed that the
macros would still work without complaint. Some compilers
(including gcc) will not treat these as synonymous without a cast.
Rather than change the include file, for portability to other
people's systems I patched around it in my code by writing:</p>
<pre class="programlisting">
#ifdef __GNUC_VA_LIST
#define va_list __gnuc_va_list
#endif
va_list argptr;
#ifdef __GNUC_VA_LIST
#undef va_list
#endif
</pre>
<p>and then writing '<tt class="literal">(va_list)argptr</tt>' when
I subsequently passed it to vsprintf (that should give you a clue
about what exactly I was trying to do). Well, I could submit a bug
report to GNU, but they've probably spotted it by now anyway.</p>
<p>I could not get &quot;<span class="application">make</span>&quot; to work,
so I just did &quot;<tt class="literal">g++ *.c++-osomething.exe</tt>&quot;
(I don't really like make utilities that force you to manually
specify the header files for each object file anyway, because this
may change with the program and one day I'd forget to update it).
It seems that C++ files must have the extension c++, hence relying
on long filenames and complicating the use of DOS editing
facilities (like my syntax highlighter). It is also worth noting
(when writing batch files etc) that the compiler will not delete an
existing executable if it finds errors, so the existence of an
executable does not imply that the last compilation actually worked
unless the executable was explicitly deleted beforehand. I had set
up a little batch file that involved redirecting the compiler's
output, but it didn't work - the stuff refused to be re-directed
(or paused). So, it was time to set a large buffer in a command
prompt window, compile the program, and scroll up (I can't see well
enough to have one of those tiny-print windows that shows you
everything at once). This is the thing about gcc: When you go
wrong, it is not always very helpful. It may say the error message,
then scroll it off the screen with a few dozen others, and then
perhaps crash with an access violation.</p>
<p>The compiler comes with a set of help files that describe the
command-line use and so on. These made the annoying mistake of
setting the text colour to black and leaving the background colour
as it is (I have it set to black by default), so I either had to
change colour scheme or copy all the text into Notepad in order to
read it. Dear reader, please don't make the same mistake. If you
can put up with that, though, there is good documentation,
especially of the included tools (some of which are quite
powerful).</p>
<p>I like GCC, now I have got used to its idiosyncrasies. I have
written a few CGI programs in it, including an &quot;access gateway&quot;
that sorts Web pages out for blind and partially sighted users
(e.g. speech users have problems with multi-column text, too many
frames have trouble with large fonts, and so on). The compilation
time is fast (although there is no indication of progress unless
errors and warnings are being printed) and it generates tight code.
It is also fairly &quot;standard&quot; - now I am no longer restricted to
being told what to do by Borland in 1991 (or whenever). I have
tried using the Win32 API and it works (if you put &quot;<tt class=
"literal">\mingw32\lib\libgdi32.a \mingw32\lib\libuser32.a</tt>&quot; on
the command line), and gcc also has a resource compiler, although
you have to look in an unlikely place to find it ('<tt class=
"literal">windres</tt>' in <tt class=
"filename">hlp/binutils.hlp</tt>).</p>
<p>Using a DOS editor under 32-bit Windows was rather awkward (all
that double scrolling and so on), and I needed a Windows editor
suitable for source code that was reasonably better than Notepad. I
found that the freeware Programmer's File Editor is quite good, the
only thing it is seriously lacking being a syntax highlighter.
Brace matching doesn't work too well if you don't put your braces
as the last thing on a line - I sometimes put a comment after an
open brace, and this confuses it. I also tried to install a port of
emacs but had little success in getting anything more than basic
editing functionality without so much as a large font, which is
hardly worth 30Mb. I then found that PFE actually manages to
capture gcc's output, which makes it definitely worth having.</p>
<p>The intriguing thing about PFE is that it displays international
characters if you have set the correct font, although it is
inconsistent - when I viewed one program with Japanese comments, it
correctly interpreted katakana in EUC-JP encoding sometimes, and at
other times treated it as some other encoding and substituted other
characters. This is particularly noticeable if you select text or
drag another window around on top of PFE (using NT's &quot;show window
contents when dragged&quot; option), but it can be coped with by using
the usual methods of dealing with screen corruption - scroll it off
and on again or highlight it. I find no evidence that PFE was
intended to display these encodings, and it is probably all a side
effect of using certain Windows functions and sometimes not giving
them all of the characters. If an unintentional feature is a bug,
then the ability to display these characters is the best bug I've
ever seen - why can't they all be like that?</p>
<p class="c2"><span class="remark">Thanks Silas. I hope that a few
more readers may be persuaded to throw in their experiences having
read about yours.</span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
