> I'm surprised the configury let you select it.
Oh, I didn't use configure. configure scripts are horrible in two big
respects[%]: (1) something like half of them get at least one thing
wrong in my experience, and it's hell to convince them they're wrong
when they are - I've typically ended up applying private patches after
running configure in those cases; (2) they're a security disaster
waiting to happen (very hard to sandbox, mind-numbing to eyeball-check,
much harder to mechanically check out than the program they're
configuring in almost all cases, which adds up to "perfect trojaning
target").
[%] I'm not alone in holding this opinion; just today, on another list,
someone said he was "starting to wonder why the Open Source developers
are so enamoured with the use of libtool, automake & autoconf"....
Not that I think any of you people would trojan it deliberately. I'm
more worried about someone cracking the distribution host, or (worse)
the desktop of some developer who regenerates configure. Yes, it's a
low-probability risk, but I haven't kept my machines secure by taking
unnecessary risks. If it hadn't been as easy to avoid as it was (see
below), I might have gone ahead...but I didn't need to.
Loosely speaking, I just started running "cc -I. -c *.c" in src/ and
"cc -I. -I.. -I../.. -c *.c" in subdirs of hid/, looking for the causes
of failures and fixing them. I converted config.h.in to config.h by
hand and added -DHAVE_CONFIG_H to the cc commands and wrote my own
Makefiles. That's all I needed to do - another benefit of the clean
architecture.
> I don't think it's supposed to allow more than one gui hid, although
> it would be cool if you could select them at runtime.
Wouldn't be hard; it'd just mean a little hacking on the code that
finds "the" GUI HID.
>> autoroute.c has an assert() referring to "region", which is not
>> declared anywhere I could find:
> Unusual. I guess we don't test with assertions enabled.
Since I found three assert()s I had to fix, I'd say that's pretty close
to certain. :-)
>> There are some more things which aren't really bugs, but are things
>> I had to change, because the compiler I'm using didn't like them.
> Which compiler?
The one that came with NetBSD 1.4T. egcs-1.1.2, it calls itself.
>> Several places have object declarations following executable code.
> That's bad and should be fixed.
Oh! Okay, I'll append my patches for those after my signature.
>> macro.h uses an unrecognized #pragma. If this is doing what it
>> looks like, it could perhaps be more portably done by #defining them
>> to something that will produce a syntax error.
> It's not quite the same. Poisoning only affects uses of the token in
> the source, not uses of the token as the expansion of a previous
> macro definition.
Ah! Okay.
> But the #if should have kept it out, perhaps we need to test gcc's
> version number too.
Yes, egcs-1.1.2 thinks of itself as GNU C - not unreasonably so; it did
come from the FSF. :)
>> and I changed the varargs DEBUGP macros in polygon1.c to match my
>> compiler's varargs macro syntax.
> Probably needs to be conditionaled on a gcc version check.
Here's what I did, but presumably you'd want something with
preprocsesor conditionals to select one or the other instead.
--- pcb-20080202.pristine/src/polygon1.c Mon Jan 14 08:02:28 2008
+++ pcb-20080202/src/polygon1.c Tue Apr 22 01:27:13 2008
@@ -104,9 +104,9 @@
#undef DEBUG_ANGLE
#undef DEBUG
#ifdef DEBUG
-#define DEBUGP(...) fprintf(stderr, ## __VA_ARGS__)
+#define DEBUGP(args...) fprintf(stderr , ## args)
#else
-#define DEBUGP(...)
+#define DEBUGP(args...)
#endif
/*
///////////////////////////////////////////////////////////////////////////// *
/
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML [EMAIL PROTECTED]
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Here are the "declarations amid executable code" patches.
--- pcb-20080202.pristine/src/edif.c Tue Jan 15 21:08:02 2008
+++ pcb-20080202/src/edif.c Tue Apr 22 00:50:32 2008
@@ -764,6 +764,12 @@
void define_pcb_net(str_pair* name, pair_list* nodes)
{
+ LibraryEntryTypePtr entry;
+ char* buf;
+ char* p;
+ int tl;
+ str_pair* done_node;
+ str_pair* node;
LibraryMenuTypePtr menu = GetLibraryMenuMemory (&PCB->NetlistLib);
if ( !name->str1 )
{
@@ -779,18 +785,14 @@
/* if renamed str2 also exists and must be freed */
if ( name->str2 ) free(name->str2);
free(name);
- LibraryEntryTypePtr entry;
- char* buf = malloc(256);
- char* p;
+ buf = malloc(256);
if ( !buf )
{
/* no memory */
pair_list_free(nodes);
return;
}
- int tl;
- str_pair* done_node;
- str_pair* node = nodes->list;
+ node = nodes->list;
free(nodes->name);
free(nodes);
while ( node )
--- pcb-20080202.pristine/src/mtspace.c Sun Jan 14 15:19:38 2007
+++ pcb-20080202/src/mtspace.c Tue Apr 22 01:24:33 2008
@@ -310,10 +310,13 @@
cbox = vector_remove_last (qc->vec);
if (setjmp (qc->env) == 0)
{
+#ifndef NDEBUG
+ int n;
+#endif
assert (__box_is_good (cbox));
qc->cbox = cbox;
#ifndef NDEBUG
- int n =
+ n =
#endif
r_search (tree, cbox, NULL, query_one, qc);
assert (n == 0);
--- pcb-20080202.pristine/src/puller.c Wed Dec 26 11:23:53 2007
+++ pcb-20080202/src/puller.c Tue Apr 22 01:29:51 2008
@@ -878,9 +878,10 @@
check_point_in_pad (PadTypePtr pad, int x, int y, End *e)
{
int inside_p;
+ int t;
printf("pad %d,%d - %d,%d t %d vs %d,%d\n", pad->Point1.X, pad->Point1.Y,
pad->Point2.X, pad->Point2.Y, pad->Thickness, x, y);
- int t = (pad->Thickness+1)/2;
+ t = (pad->Thickness+1)/2;
if (TEST_FLAG (SQUAREFLAG, pad))
{
inside_p = (x >= MIN (pad->Point1.X - t, pad->Point2.X - t)
@@ -1886,6 +1887,7 @@
create_arc (LineTypePtr sample, int x, int y, int r, int sa, int da)
{
Extra *e, *new_arcs;
+ ArcTypePtr arc;
if (r % 100 == 1)
r--;
if (r % 100 == 99)
@@ -1893,7 +1895,7 @@
#if TRACE1
printf("create_arc at %d,%d r %d sa %d delta %d\n", x, y, r, sa, da);
#endif
- ArcTypePtr arc = CreateNewArcOnLayer (CURRENT, x, y, r, r, sa, da,
+ arc = CreateNewArcOnLayer (CURRENT, x, y, r, r, sa, da,
sample->Thickness, sample->Clearance,
sample->Flags);
if (arc == 0)
{
--- pcb-20080202.pristine/src/report.c Tue Dec 11 09:00:07 2007
+++ pcb-20080202/src/report.c Tue Apr 22 01:33:04 2008
@@ -136,6 +136,7 @@
{
case VIA_TYPE:
{
+ PinTypePtr via;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -143,7 +144,7 @@
return 0;
}
#endif
- PinTypePtr via = (PinTypePtr) ptr2;
+ via = (PinTypePtr) ptr2;
if (TEST_FLAG (HOLEFLAG, via))
sprintf (&report[0], "VIA ID# %ld Flags:%s\n"
"(X,Y) = (%d, %d)\n"
@@ -173,6 +174,8 @@
}
case PIN_TYPE:
{
+ PinTypePtr Pin;
+ ElementTypePtr element;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -180,8 +183,8 @@
return 0;
}
#endif
- PinTypePtr Pin = (PinTypePtr) ptr2;
- ElementTypePtr element = (ElementTypePtr) ptr1;
+ Pin = (PinTypePtr) ptr2;
+ element = (ElementTypePtr) ptr1;
PIN_LOOP (element);
{
@@ -220,6 +223,7 @@
}
case LINE_TYPE:
{
+ LineTypePtr line;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -228,7 +232,7 @@
return 0;
}
#endif
- LineTypePtr line = (LineTypePtr) ptr2;
+ line = (LineTypePtr) ptr2;
sprintf (&report[0], "LINE ID# %ld Flags:%s\n"
"FirstPoint(X,Y) = (%d, %d) ID = %ld\n"
"SecondPoint(X,Y) = (%d, %d) ID = %ld\n"
@@ -249,6 +253,7 @@
}
case RATLINE_TYPE:
{
+ RatTypePtr line;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -256,7 +261,7 @@
return 0;
}
#endif
- RatTypePtr line = (RatTypePtr) ptr2;
+ line = (RatTypePtr) ptr2;
sprintf (&report[0], "RAT-LINE ID# %ld Flags:%s\n"
"FirstPoint(X,Y) = (%d, %d) ID = %ld "
"connects to layer group %d\n"
@@ -271,6 +276,8 @@
}
case ARC_TYPE:
{
+ ArcTypePtr Arc;
+ BoxTypePtr box;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -279,8 +286,8 @@
return 0;
}
#endif
- ArcTypePtr Arc = (ArcTypePtr) ptr2;
- BoxTypePtr box = GetArcEnds (Arc);
+ Arc = (ArcTypePtr) ptr2;
+ box = GetArcEnds (Arc);
sprintf (&report[0], "ARC ID# %ld Flags:%s\n"
"CenterPoint(X,Y) = (%d, %d)\n"
@@ -303,6 +310,7 @@
}
case POLYGON_TYPE:
{
+ PolygonTypePtr Polygon;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -311,7 +319,7 @@
return;
}
#endif
- PolygonTypePtr Polygon = (PolygonTypePtr) ptr2;
+ Polygon = (PolygonTypePtr) ptr2;
sprintf (&report[0], "POLYGON ID# %ld Flags:%s\n"
"Its bounding box is (%d,%d) (%d,%d)\n"
@@ -330,6 +338,8 @@
case PAD_TYPE:
{
int len, dx, dy, mgap;
+ PadTypePtr Pad;
+ ElementTypePtr element;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -337,8 +347,8 @@
return 0;
}
#endif
- PadTypePtr Pad = (PadTypePtr) ptr2;
- ElementTypePtr element = (ElementTypePtr) ptr1;
+ Pad = (PadTypePtr) ptr2;
+ element = (ElementTypePtr) ptr1;
PAD_LOOP (element);
{
@@ -379,6 +389,7 @@
}
case ELEMENT_TYPE:
{
+ ElementTypePtr element;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -386,7 +397,7 @@
return 0;
}
#endif
- ElementTypePtr element = (ElementTypePtr) ptr2;
+ element = (ElementTypePtr) ptr2;
sprintf (&report[0], "ELEMENT ID# %ld Flags:%s\n"
"BoundingBox (%d,%d) (%d,%d)\n"
"Descriptive Name \"%s\"\n"
@@ -423,6 +434,8 @@
#endif
case ELEMENTNAME_TYPE:
{
+ char laynum[32];
+ TextTypePtr text;
#ifndef NDEBUG
if (gui->shift_is_pressed ())
{
@@ -430,8 +443,7 @@
return 0;
}
#endif
- char laynum[32];
- TextTypePtr text = (TextTypePtr) ptr2;
+ text = (TextTypePtr) ptr2;
if (type == TEXT_TYPE)
sprintf (laynum, "is on layer %d",
_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev