From: uz Date: Thu, 7 Jun 2012 19:59:51 +0000 (+0000) Subject: In error or warning messages, output the name of the library if this is X-Git-Tag: V2.14~373 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5cf9f585a64163e9e080495d488b93657e2187f3;p=cc65 In error or warning messages, output the name of the library if this is relevant. It's otherwise difficult to know what happens when ar65 is called from within a makefile or similar. git-svn-id: svn://svn.cc65.org/cc65/trunk@5695 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ar65/exports.c b/src/ar65/exports.c index 488d58497..8f74c670f 100644 --- a/src/ar65/exports.c +++ b/src/ar65/exports.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2011, Ullrich von Bassewitz */ +/* (C) 1998-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -41,6 +41,7 @@ /* ar65 */ #include "error.h" +#include "library.h" #include "objdata.h" #include "exports.h" @@ -112,9 +113,9 @@ void ExpInsert (const char* Name, const ObjData* Module) while (1) { if (strcmp (L->Name, Name) == 0) { /* Duplicate entry */ - Warning ("External symbol `%s' in module `%s' is duplicated in " - "module `%s'", - Name, L->Name, Module->Name); + Warning ("External symbol `%s' in module `%s', library `%s' " + "is duplicated in module `%s'", + Name, L->Name, LibName, Module->Name); } if (L->Next == 0) { break; diff --git a/src/ar65/library.c b/src/ar65/library.c index cffb85cd1..c7c9e02c2 100644 --- a/src/ar65/library.c +++ b/src/ar65/library.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2011, Ullrich von Bassewitz */ +/* (C) 1998-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -60,14 +60,16 @@ /*****************************************************************************/ + +/* Name of the library file */ +const char* LibName = 0; /* File descriptor for the library file */ FILE* NewLib = 0; static FILE* Lib = 0; -static const char* LibName = 0; /* The library header */ -static LibHeader Header = { +static LibHeader Header = { LIB_MAGIC, LIB_VERSION, 0, @@ -99,7 +101,7 @@ static void ReadHeader (void) } Header.Flags = Read16 (Lib); Header.IndexOffs = Read32 (Lib); -} +} @@ -388,7 +390,7 @@ void LibClose (void) } if (NewLib && fclose (NewLib) != 0) { Error ("Problem closing temporary library file: %s", strerror (errno)); - } + } } diff --git a/src/ar65/library.h b/src/ar65/library.h index bd4b6edbd..09a489478 100644 --- a/src/ar65/library.h +++ b/src/ar65/library.h @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 1998 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 1998-2012, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -48,6 +48,9 @@ +/* Name of the library file */ +extern const char* LibName; + /* File descriptor for the new library file */ extern FILE* NewLib; @@ -73,7 +76,7 @@ unsigned long LibCopyTo (FILE* F, unsigned long Bytes); void LibCopyFrom (unsigned long Pos, unsigned long Bytes, FILE* F); /* Copy data from the library file into another file */ -void LibClose (void); +void LibClose (void); /* Write remaining data, close both files and copy the temp file to the old * filename */ diff --git a/src/ar65/main.c b/src/ar65/main.c index b2ba84ee9..6daf24324 100644 --- a/src/ar65/main.c +++ b/src/ar65/main.c @@ -6,12 +6,12 @@ /* */ /* */ /* */ -/* (C) 1998-2011, Ullrich von Bassewitz */ +/* (C) 1998-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ -/* */ -/* */ +/* */ +/* */ /* This software is provided 'as-is', without any expressed or implied */ /* warranty. In no event will the authors be held liable for any damages */ /* arising from the use of this software. */ @@ -121,7 +121,7 @@ int main (int argc, char* argv []) case 'V': fprintf (stderr, - "ar65 V%s - (C) Copyright 1998-2011 Ullrich von Bassewitz\n", + "ar65 V%s - (C) Copyright 1998-2012 Ullrich von Bassewitz\n", GetVersionAsString ()); break; diff --git a/src/ar65/objdata.c b/src/ar65/objdata.c index e6c8372b7..b22ad023a 100644 --- a/src/ar65/objdata.c +++ b/src/ar65/objdata.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2011, Ullrich von Bassewitz */ +/* (C) 1998-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -41,6 +41,7 @@ /* ar65 */ #include "error.h" +#include "library.h" #include "objdata.h" @@ -107,7 +108,7 @@ void FreeObjData (ObjData* O) void ClearObjData (ObjData* O) /* Remove any data stored in O */ { - unsigned I; + unsigned I; xfree (O->Name); O->Name = 0; for (I = 0; I < CollCount (&O->Strings); ++I) { @@ -164,7 +165,7 @@ void DelObjData (const char* Module) } /* Not found! */ - Warning ("Module `%s' not found in library", Module); + Warning ("Module `%s' not found in library `%s'", Module, LibName); } diff --git a/src/ar65/objfile.c b/src/ar65/objfile.c index 1d52f7061..7d349c725 100644 --- a/src/ar65/objfile.c +++ b/src/ar65/objfile.c @@ -267,7 +267,8 @@ void ObjAdd (const char* Name) * and the external one. */ if (difftime ((time_t)O->MTime, StatBuf.st_mtime) > 0.0) { - Warning ("Replacing module `%s' by older version", O->Name); + Warning ("Replacing module `%s' by older version in library `%s'", + O->Name, LibName); } /* Free data */ @@ -312,7 +313,7 @@ void ObjExtract (const char* Name) /* Bail out if the module does not exist */ if (O == 0) { - Error ("Module `%s' not found in library", Module); + Error ("Module `%s' not found in library `%s'", Module, LibName); } /* Open the output file */