Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Extremely strange behavior of bcc32 compiler


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Mariusz Lisowski

Posts: 12
Registered: 2/28/06
Extremely strange behavior of bcc32 compiler  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 6, 2016 4:17 PM
Hi,
I don't understand strongly why my bcc32 in CodeGear2009 successfully compille without any errors this source:
#include <stdio.h>
//include "dnsscan.h"
//include "gates-info.h"
#include "process_file.h"
//include "html_pl.h"
#include "html_pl.h"
#include "html_en.h"
#include "html_de.h"
#include "html_fr.h"
 
struct zone zones[ZONES];
extern FILE *fptr_pl;
extern FILE *fptr_en;
extern FILE *fptr_de;
extern FILE *fptr_fr;
extern struct class_c rec[0x100];
 
const char *zone_header_pl =
"<br>\n";
/*
"<div><span class="\"c11\"">s adresy w zakresie [%s - %s]</span></div>\n"
"<span class="\"c8\"">Koordynator:  </span>\n"
"<span class="\"c9\"">%s</span>\n"
"<script type=\"text/javascript\" src=\"%s\"></script>\n"
"<!--<a href=\"%s\" target=\"_self\" title=\"Kontakt z Koordynatorem\"><img src=\"./image/koperta.png\" alt=\"\" class=\"c33\"></a>-->\n"
"<table class=\"c22\">\n"
"<thead>\n"
"\t<tr class=\"c12\">\n"\
"\t\t<td class=\"c23\">Trasa do bramki</td>\n"\
"\t\t<td class=\"c24\">QTH</td>\n"\
"\t\t<td class=\"c25\">Znak bramki</td>\n"\
"\t\t<td class=\"c26\">Info</td>\n"\
"\t\t<td class=\"c27\">Domeny</td>\n"\
"\t</tr>\n"\
"</thead>\n\x0";
*/
 
extern const char *zone_header_en;
extern const char *zone_header_en;
int i;
int i;
 
//------------------------------------------------------------------------------
int PrintArea(const char zone)
{
int x = 0, j = 0;
unsigned int subnet_size = 0, subnet_registered = 0, i = 0, end = 0;
 
end = zones[zone].subnet + zones[zone].subnets;
i = zones[zone].subnet;
 
//fprintf(fptr_pl, "%s%s%s%s%s",
//		"<tr><td></td><td></td><td></td><td></td><td></td></tr>\n",
//		"<tr><td></td><td></td><td></td><td></td><td></td></tr>\n",
//		"<tr><td></td><td></td><td></td><td></td><td></td></tr>\n",
//		"<tr><td></td><td></td><td></td><td></td><td></td></tr>\n",
//		"<tr><td></td><td></td><td></td><td></td><td></td></tr>\n"
//		);
 
fprintf(fptr_pl, zone_header_pl,
		zones[zone].description,
		zones[zone].addr_begin,
		zones[zone].addr_end,
		zones[zone].Koordynator_name,
		zones[zone].Koordynator_mail
		);
 
fprintf(fptr_en, zone_header_en,
		//zones[zone].description,
		"x",
		//zones[zone].addr_begin,
		"x",
		//zones[zone].addr_end,
		"x",
		//zones[zone].Koordynator_name,
		"x",
		//zones[zone].Koordynator_mail
          		"x"
		);
 
fprintf(fptr_de, zone_header_de,
		zones[zone].description,
		zones[zone].addr_begin,
		zones[zone].addr_end,
		zones[zone].Koordynator_name,
		zones[zone].Koordynator_mail
		);
 
fprintf(fptr_fr, zone_header_fr,
		zones[zone].description,
		zones[zone].addr_begin,
		zones[zone].addr_end,
		zones[zone].Koordynator_name,
		zones[zone].Koordynator_mail
		);
 
for(; i < end; i++)
	{
	if(rec[i].root.line[0] != 0)
		{
#ifdef DNS_POOLING
		dnsscan(i, 0, rec[i].root.addr.mask, &subnet_size, &subnet_registered);
#endif
		fprintf(fptr_pl, zone_item_pl,
		rec[i].root.line,
		rec[i].root.qth,
		rec[i].root.call, rec[i].root.qthloc, rec[i].root.call, rec[i].root.sysop_mail,
		i, 0,
		subnet_registered,
		subnet_size);
 
		fprintf(fptr_en, zone_item_en,
		rec[i].root.line,
		rec[i].root.qth,
		rec[i].root.call, rec[i].root.qthloc, rec[i].root.call, rec[i].root.sysop_mail,
		i, 0,
		subnet_registered,
		subnet_size);
 
		fprintf(fptr_de, zone_item_de,
		rec[i].root.line,
		rec[i].root.qth,
		rec[i].root.call, rec[i].root.qthloc, rec[i].root.call, rec[i].root.sysop_mail,
		i, 0,
		subnet_registered,
		subnet_size);
 
		fprintf(fptr_fr, zone_item_fr,
		rec[i].root.line,
		rec[i].root.qth,
		rec[i].root.call, rec[i].root.qthloc, rec[i].root.call, rec[i].root.sysop_mail,
		i, 0,
		subnet_registered,
		subnet_size);
 
		x = 1;
		}
 
		for(j = 0; j < 0x100; j++)
			{
			if(rec[i].branch[j].line[0] != 0)
				{
#ifdef DNS_POOLING
				dnsscan(i, j, rec[i].branch[j].addr.mask, &subnet_size, &subnet_registered);
#endif
				fprintf(fptr_pl, zone_item_pl,
				rec[i].branch[j].line,
				rec[i].branch[j].qth,
				rec[i].branch[j].call, rec[i].branch[j].qthloc, rec[i].branch[j].call, rec[i].branch[j].sysop_mail,
				i, j,
				subnet_registered,
				subnet_size);
 
				fprintf(fptr_en, zone_item_en,
				rec[i].branch[j].line,
				rec[i].branch[j].qth,
				rec[i].branch[j].call, rec[i].branch[j].qthloc, rec[i].branch[j].call, rec[i].branch[j].sysop_mail,
				i, j,
				subnet_registered,
				subnet_size);
 
				fprintf(fptr_de, zone_item_de,
				rec[i].branch[j].line,
				rec[i].branch[j].qth,
				rec[i].branch[j].call, rec[i].branch[j].qthloc, rec[i].branch[j].call, rec[i].branch[j].sysop_mail,
				i, j,
				subnet_registered,
				subnet_size);
 
				fprintf(fptr_fr, zone_item_fr,
				rec[i].branch[j].line,
				rec[i].branch[j].qth,
				rec[i].branch[j].call, rec[i].branch[j].qthloc, rec[i].branch[j].call, rec[i].branch[j].sysop_mail,
				i, j,
				subnet_registered,
				subnet_size);
 
				x = 1;
				}
			}
	};
if(x == 0)
	{
	fprintf(fptr_pl, "<tr><td></td><td></td><td></td><td></td><td></td></tr>\n");
	fprintf(fptr_en, "<tr><td></td><td></td><td></td><td></td><td></td></tr>\n");
	fprintf(fptr_de, "<tr><td></td><td></td><td></td><td></td><td></td></tr>\n");
	fprintf(fptr_fr, "<tr><td></td><td></td><td></td><td></td><td></td></tr>\n");
	}
 
fprintf(fptr_pl, "</table>\n");
fprintf(fptr_en, "</table>\n");
fprintf(fptr_de, "</table>\n");
fprintf(fptr_fr, "</table>\n");
return(0);
}
//------------------------------------------------------------------------------ 


What is strange ? I see something like this first time at my long programmer life :)
We have multiple declaration of these some variables and I DON'T GET ANY WARNINGS OR ERRORS from bcc32.exe compiler.
Executable doesn't crash and doesn't generate exception. Generally doesn't work correct. I am surprised because it is really clean C code.
This code works well with gcc all versions (they stop with errors) but are problems with bcc32 (for bcc32 no errors).
Can somebody tell me what I make wrong ... ? I tried compile this code on other machine with Builder2009 and result is some. I suspected some software emergency but result is some there. We can exclude this case of reason.

I say about lines:

extern const char *zone_header_en;
extern const char *zone_header_en;
int i;
int i;

Regards, Mariusz

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02