🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Thomas Hildebrandt Wed, 06 Dec 1989 18:04
Compiler hangs
#686
Author: Thomas Hildebrandt
Date: Wed, 06 Dec 1989 18:04
91 lines
2600 bytes
	I believe that a correctly functioning compiler always terminates, so
that when it does not do so, one may immediately conclude that he has
uncovered a bug.  Since the code which causes the bug appears to be
erroneous, and correct code compiles successfully, the bug can be considered
rather trivial, and therefore be assigned a low priority.
	The G++ version is 1.34, the environment is a VAX 3600 running DEC's
version of UNIX (Ultrix, or whatever they call it), I can find the version
number for you, but the error appears to be of the machine-independent
variety.  (I'm sure you also hope so.)  I have isolated the function which
causes the error.  Code follows.
				Thomas H. Hildebrandt
				delta@csl.ncsu.edu
				H: (919)851-9528
				W: (919)737-7610
				FAX(919)737-3027


#include "dict.h"
#include "misc.h"

typedef FILE* FILE_;
declare(dict,FILE_);

dict(FILE_) Filenames;

void close_files(void) // G++.1.34 compiler hangs in this function.
{
 Filenames.map(fclose);
}

// misc.hpp
#ifndef MISCH
#define MISCH


#include <stdio.h>

FILE* get_file(string Filename, string Control);


#endif
// DICT.H

#ifndef DICTH
#define DICTH
#include "define.h"
#include "generic.h"

struct item
{
 string name;
 void* value_;
 item* next_;
};

typedef void (*PVFVP)(void*);

class dictionary
{
 item* list_;

public:
    dictionary(void){list_ = NULL;}
    ~dictionary(void);
 void insert(string Name, void* Value_);
 // Insert Value_ into dictionary, indexed by Name.
 void* find(string Name);
 // Search dictionary for entry Name and return its value.
 void remove(string Name);
 // Find the entry indexed by Name and delete it.
 void map(PVFVP);
 // Map the function to all dictionary entries.
};

#define dict(type) name2(type,dict)

#define dictdeclare(type) \
typedef void (*PVFtype)(type); \
struct dict(type):dictionary\
{\
 void insert(string Name, type Value_) { dictionary::insert(Name, Value_); }\
 type find(string Name) { return (type) dictionary::find(Name); }\
 void remove(string Name) {dictionary::remove(Name);}\
 void map(PVFtype fcn_) {dictionary::map((PVFVP) fcn_); } \
};

#endif


// P.S.  Have fun.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads