1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 15:29:46 +00:00

Use __attribute ((unused)) instead of -Wno-unused-parameter

git-svn-id: svn://svn.cc65.org/cc65/trunk@988 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-09-30 22:19:39 +00:00
parent 453a8b704f
commit 91dac51780
13 changed files with 125 additions and 103 deletions

View File

@ -129,7 +129,8 @@ void ClearLineInfo (void)
static int CmpLineInfo (void* Data, const void* LI1_, const void* LI2_)
static int CmpLineInfo (void* Data attribute ((unused)),
const void* LI1_, const void* LI2_)
/* Compare function for the sort */
{
/* Cast the pointers */

View File

@ -758,7 +758,7 @@ void MacAbort (void)
int IsMacro (const char* Name)
/* Return true if the given name is the name of a macro */
{
return MacFind (SVal, HashStr (SVal) % HASHTAB_SIZE) != 0;
return MacFind (Name, HashStr (Name) % HASHTAB_SIZE) != 0;
}
@ -766,7 +766,7 @@ int IsMacro (const char* Name)
int IsDefine (const char* Name)
/* Return true if the given name is the name of a define style macro */
{
Macro* M = MacFind (SVal, HashStr (SVal) % HASHTAB_SIZE);
Macro* M = MacFind (Name, HashStr (Name) % HASHTAB_SIZE);
return (M != 0 && M->Style == MAC_STYLE_DEFINE);
}

View File

@ -186,7 +186,8 @@ static void DefineSymbol (const char* Def)
static void OptAutoImport (const char* Opt, const char* Arg)
static void OptAutoImport (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Mark unresolved symbols as imported */
{
AutoImport = 1;
@ -194,12 +195,9 @@ static void OptAutoImport (const char* Opt, const char* Arg)
static void OptCPU (const char* Opt, const char* Arg)
static void OptCPU (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --cpu option */
{
if (Arg == 0) {
NeedArg (Opt);
}
if (strcmp (Arg, "6502") == 0) {
SetCPU (CPU_6502);
} else if (strcmp (Arg, "65C02") == 0) {
@ -217,7 +215,8 @@ static void OptCPU (const char* Opt, const char* Arg)
static void OptDebugInfo (const char* Opt, const char* Arg)
static void OptDebugInfo (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Add debug info to the object file */
{
DbgSyms = 1;
@ -225,7 +224,7 @@ static void OptDebugInfo (const char* Opt, const char* Arg)
static void OptFeature (const char* Opt, const char* Arg)
static void OptFeature (const char* Opt attribute ((unused)), const char* Arg)
/* Set an emulation feature */
{
/* Set the feature, check for errors */
@ -236,7 +235,8 @@ static void OptFeature (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
{
Usage ();
@ -245,7 +245,8 @@ static void OptHelp (const char* Opt, const char* Arg)
static void OptIgnoreCase (const char* Opt, const char* Arg)
static void OptIgnoreCase (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Ignore case on symbols */
{
IgnoreCase = 1;
@ -253,18 +254,16 @@ static void OptIgnoreCase (const char* Opt, const char* Arg)
static void OptIncludeDir (const char* Opt, const char* Arg)
static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
/* Add an include search path */
{
if (Arg == 0) {
NeedArg (Opt);
}
AddIncludePath (Arg);
}
static void OptListing (const char* Opt, const char* Arg)
static void OptListing (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Create a listing file */
{
Listing = 1;
@ -272,14 +271,10 @@ static void OptListing (const char* Opt, const char* Arg)
static void OptPageLength (const char* Opt, const char* Arg)
static void OptPageLength (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --pagelength option */
{
int Len;
if (Arg == 0) {
NeedArg (Opt);
}
Len = atoi (Arg);
int Len = atoi (Arg);
if (Len != -1 && (Len < MIN_PAGE_LEN || Len > MAX_PAGE_LEN)) {
AbEnd ("Invalid page length: %d", Len);
}
@ -288,7 +283,8 @@ static void OptPageLength (const char* Opt, const char* Arg)
static void OptSmart (const char* Opt, const char* Arg)
static void OptSmart (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the -s/--smart options */
{
SmartMode = 1;
@ -296,13 +292,9 @@ static void OptSmart (const char* Opt, const char* Arg)
static void OptTarget (const char* Opt, const char* Arg)
static void OptTarget (const char* Opt attribute ((unused)), const char* Arg)
/* Set the target system */
{
if (Arg == 0) {
NeedArg (Opt);
}
/* Map the target name to a target id */
Target = FindTarget (Arg);
if (Target == TGT_UNKNOWN) {
@ -312,7 +304,8 @@ static void OptTarget (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Increase verbosity */
{
++Verbosity;
@ -320,7 +313,8 @@ static void OptVerbose (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the assembler version */
{
fprintf (stderr,

View File

@ -5,7 +5,7 @@
# Library dir
COMMON = ../common
CFLAGS = -g -O2 -Wall -W -Wno-unused-parameter -I$(COMMON)
CFLAGS = -g -O2 -Wall -W -I$(COMMON)
CC = gcc
EBIND = emxbind
LDFLAGS =

View File

@ -1023,13 +1023,14 @@ void SymDump (FILE* F)
while (S) {
/* Ignore trampoline symbols */
if ((S->Flags & SF_TRAMPOLINE) != 0) {
printf ("%-24s %s %s %s %s %s\n",
S->Name,
(S->Flags & SF_DEFINED)? "DEF" : "---",
(S->Flags & SF_REFERENCED)? "REF" : "---",
(S->Flags & SF_IMPORT)? "IMP" : "---",
(S->Flags & SF_EXPORT)? "EXP" : "---",
(S->Flags & SF_ZP)? "ZP" : "--");
fprintf (F,
"%-24s %s %s %s %s %s\n",
S->Name,
(S->Flags & SF_DEFINED)? "DEF" : "---",
(S->Flags & SF_REFERENCED)? "REF" : "---",
(S->Flags & SF_IMPORT)? "IMP" : "---",
(S->Flags & SF_EXPORT)? "EXP" : "---",
(S->Flags & SF_ZP)? "ZP" : "--");
}
/* Next symbol */
S = S->List;

View File

@ -589,7 +589,8 @@ static void Usage (void)
static void OptAddSource (const char* Opt, const char* Arg)
static void OptAddSource (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Strict source code as comments to the generated asm code */
{
CmdAddArg (&CC65, "-T");
@ -597,7 +598,8 @@ static void OptAddSource (const char* Opt, const char* Arg)
static void OptAnsi (const char* Opt, const char* Arg)
static void OptAnsi (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Strict ANSI mode (compiler) */
{
CmdAddArg (&CC65, "-A");
@ -605,7 +607,7 @@ static void OptAnsi (const char* Opt, const char* Arg)
static void OptAsmIncludeDir (const char* Opt, const char* Arg)
static void OptAsmIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
/* Include directory (assembler) */
{
CmdAddArg (&CA65, "-I");
@ -614,7 +616,7 @@ static void OptAsmIncludeDir (const char* Opt, const char* Arg)
static void OptBssName (const char* Opt, const char* Arg)
static void OptBssName (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --bss-name option */
{
CmdAddArg (&CC65, "--bss-name");
@ -623,7 +625,8 @@ static void OptBssName (const char* Opt, const char* Arg)
static void OptCheckStack (const char* Opt, const char* Arg)
static void OptCheckStack (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the --check-stack option */
{
CmdAddArg (&CC65, "--check-stack");
@ -631,7 +634,7 @@ static void OptCheckStack (const char* Opt, const char* Arg)
static void OptCodeName (const char* Opt, const char* Arg)
static void OptCodeName (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --code-name option */
{
CmdAddArg (&CC65, "--code-name");
@ -640,7 +643,7 @@ static void OptCodeName (const char* Opt, const char* Arg)
static void OptCodeSize (const char* Opt, const char* Arg)
static void OptCodeSize (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --codesize option */
{
CmdAddArg (&CC65, "--codesize");
@ -649,7 +652,7 @@ static void OptCodeSize (const char* Opt, const char* Arg)
static void OptCPU (const char* Opt, const char* Arg)
static void OptCPU (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --cpu option */
{
/* Add the cpu type to the assembler and compiler */
@ -661,7 +664,8 @@ static void OptCPU (const char* Opt, const char* Arg)
static void OptCreateDep (const char* Opt, const char* Arg)
static void OptCreateDep (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the --create-dep option */
{
CmdAddArg (&CC65, "--create-dep");
@ -669,7 +673,7 @@ static void OptCreateDep (const char* Opt, const char* Arg)
static void OptDataName (const char* Opt, const char* Arg)
static void OptDataName (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --data-name option */
{
CmdAddArg (&CC65, "--data-name");
@ -678,7 +682,8 @@ static void OptDataName (const char* Opt, const char* Arg)
static void OptDebug (const char* Opt, const char* Arg)
static void OptDebug (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Debug mode (compiler) */
{
CmdAddArg (&CC65, "-d");
@ -686,7 +691,8 @@ static void OptDebug (const char* Opt, const char* Arg)
static void OptDebugInfo (const char* Opt, const char* Arg)
static void OptDebugInfo (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Debug Info - add to compiler and assembler */
{
CmdAddArg (&CC65, "-g");
@ -695,7 +701,7 @@ static void OptDebugInfo (const char* Opt, const char* Arg)
static void OptFeature (const char* Opt, const char* Arg)
static void OptFeature (const char* Opt attribute ((unused)), const char* Arg)
/* Emulation features for the assembler */
{
CmdAddArg (&CA65, "--feature");
@ -704,7 +710,8 @@ static void OptFeature (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print help - cl65 */
{
Usage ();
@ -713,7 +720,7 @@ static void OptHelp (const char* Opt, const char* Arg)
static void OptIncludeDir (const char* Opt, const char* Arg)
static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
/* Include directory (compiler) */
{
CmdAddArg (&CC65, "-I");
@ -722,7 +729,8 @@ static void OptIncludeDir (const char* Opt, const char* Arg)
static void OptListing (const char* Opt, const char* Arg)
static void OptListing (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Create an assembler listing */
{
CmdAddArg (&CA65, "-l");
@ -730,7 +738,7 @@ static void OptListing (const char* Opt, const char* Arg)
static void OptMapFile (const char* Opt, const char* Arg)
static void OptMapFile (const char* Opt attribute ((unused)), const char* Arg)
/* Create a map file */
{
/* Create a map file (linker) */
@ -740,7 +748,7 @@ static void OptMapFile (const char* Opt, const char* Arg)
static void OptRodataName (const char* Opt, const char* Arg)
static void OptRodataName (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --rodata-name option */
{
CmdAddArg (&CC65, "--rodata-name");
@ -749,7 +757,8 @@ static void OptRodataName (const char* Opt, const char* Arg)
static void OptSignedChars (const char* Opt, const char* Arg)
static void OptSignedChars (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Make default characters signed */
{
CmdAddArg (&CC65, "-j");
@ -757,7 +766,7 @@ static void OptSignedChars (const char* Opt, const char* Arg)
static void OptStartAddr (const char* Opt, const char* Arg)
static void OptStartAddr (const char* Opt attribute ((unused)), const char* Arg)
/* Set the default start address */
{
CmdAddArg (&LD65, "-S");
@ -766,7 +775,8 @@ static void OptStartAddr (const char* Opt, const char* Arg)
static void OptStaticLocals (const char* Opt, const char* Arg)
static void OptStaticLocals (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Place local variables in static storage */
{
CmdAddArg (&CC65, "-Cl");
@ -774,7 +784,7 @@ static void OptStaticLocals (const char* Opt, const char* Arg)
static void OptTarget (const char* Opt, const char* Arg)
static void OptTarget (const char* Opt attribute ((unused)), const char* Arg)
/* Set the target system */
{
Target = FindTarget (Arg);
@ -785,7 +795,8 @@ static void OptTarget (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Verbose mode (compiler, assembler, linker) */
{
CmdAddArg (&CC65, "-v");
@ -795,7 +806,8 @@ static void OptVerbose (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print version number */
{
fprintf (stderr,

View File

@ -6,7 +6,7 @@
COMMON = ../common
CC=gcc
CFLAGS = -O2 -g -Wall -W -Wno-unused-parameter -I$(COMMON)
CFLAGS = -O2 -g -Wall -W -I$(COMMON)
EBIND = emxbind
LDFLAGS=

View File

@ -39,17 +39,21 @@
#include <sys/types.h>
#include <sys/wait.h>
/* common */
#include "attrib.h"
/* cl65 */
#include "error.h"
/*****************************************************************************/
/* Code */
/* Code */
/*****************************************************************************/
int spawnvp (int Mode, const char* File, char* const argv [])
int spawnvp (int Mode attribute ((unused)), const char* File, char* const argv [])
/* Execute the given program searching and wait til it terminates. The Mode
* argument is ignored (compatibility only). The result of the function is
* the return code of the program. The function will terminate the program

View File

@ -238,14 +238,14 @@ void OH_AbsoluteY (const OpcDesc* D)
void OH_AbsoluteLong (const OpcDesc* D)
void OH_AbsoluteLong (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_AbsoluteLongX (const OpcDesc* D)
void OH_AbsoluteLongX (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
@ -269,7 +269,7 @@ void OH_Relative (const OpcDesc* D)
void OH_RelativeLong (const OpcDesc* D)
void OH_RelativeLong (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
@ -332,49 +332,49 @@ void OH_AbsoluteIndirect (const OpcDesc* D)
void OH_StackRelative (const OpcDesc* D)
void OH_StackRelative (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_DirectIndirectLongX (const OpcDesc* D)
void OH_DirectIndirectLongX (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_StackRelativeIndirectY (const OpcDesc* D)
void OH_StackRelativeIndirectY (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_DirectIndirectLong (const OpcDesc* D)
void OH_DirectIndirectLong (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_DirectIndirectLongY (const OpcDesc* D)
void OH_DirectIndirectLongY (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_BlockMove (const OpcDesc* D)
void OH_BlockMove (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
void OH_AbsoluteXIndirect (const OpcDesc* D)
void OH_AbsoluteXIndirect (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
}
@ -405,4 +405,3 @@ void OH_JmpAbsoluteIndirect (const OpcDesc* D)

View File

@ -143,7 +143,8 @@ static void OptCPU (const char* Opt, const char* Arg)
static void OptFormFeeds (const char* Opt, const char* Arg)
static void OptFormFeeds (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Add form feeds to the output */
{
FormFeeds = 1;
@ -151,7 +152,8 @@ static void OptFormFeeds (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
{
Usage ();
@ -160,14 +162,10 @@ static void OptHelp (const char* Opt, const char* Arg)
static void OptPageLength (const char* Opt, const char* Arg)
static void OptPageLength (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --pagelength option */
{
int Len;
if (Arg == 0) {
NeedArg (Opt);
}
Len = atoi (Arg);
int Len = atoi (Arg);
if (Len != 0 && (Len < MIN_PAGE_LEN || Len > MAX_PAGE_LEN)) {
AbEnd ("Invalid page length: %d", Len);
}
@ -184,7 +182,8 @@ static void OptStartAddr (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Increase verbosity */
{
++Verbosity;
@ -192,7 +191,8 @@ static void OptVerbose (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the disassembler version */
{
fprintf (stderr,

View File

@ -5,7 +5,7 @@
# Library dir
COMMON = ../common
CFLAGS = -g -O2 -Wall -W -Wno-unused-parameter -I$(COMMON)
CFLAGS = -g -O2 -Wall -W -I$(COMMON)
CC=gcc
EBIND=emxbind
LDFLAGS=

View File

@ -93,7 +93,8 @@ static void Usage (void)
static void OptDumpAll (const char* Opt, const char* Arg)
static void OptDumpAll (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump all object file information */
{
What |= D_ALL;
@ -101,7 +102,8 @@ static void OptDumpAll (const char* Opt, const char* Arg)
static void OptDumpDbgSyms (const char* Opt, const char* Arg)
static void OptDumpDbgSyms (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump debug symbols contained in the object file */
{
What |= D_DBGSYMS;
@ -109,7 +111,8 @@ static void OptDumpDbgSyms (const char* Opt, const char* Arg)
static void OptDumpExports (const char* Opt, const char* Arg)
static void OptDumpExports (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the exported symbols */
{
What |= D_EXPORTS;
@ -117,7 +120,8 @@ static void OptDumpExports (const char* Opt, const char* Arg)
static void OptDumpFiles (const char* Opt, const char* Arg)
static void OptDumpFiles (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the source files */
{
What |= D_FILES;
@ -125,7 +129,8 @@ static void OptDumpFiles (const char* Opt, const char* Arg)
static void OptDumpHeader (const char* Opt, const char* Arg)
static void OptDumpHeader (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the object file header */
{
What |= D_HEADER;
@ -133,7 +138,8 @@ static void OptDumpHeader (const char* Opt, const char* Arg)
static void OptDumpImports (const char* Opt, const char* Arg)
static void OptDumpImports (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the imported symbols */
{
What |= D_IMPORTS;
@ -141,7 +147,8 @@ static void OptDumpImports (const char* Opt, const char* Arg)
static void OptDumpLineInfo (const char* Opt, const char* Arg)
static void OptDumpLineInfo (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the line infos */
{
What |= D_LINEINFO;
@ -149,7 +156,8 @@ static void OptDumpLineInfo (const char* Opt, const char* Arg)
static void OptDumpOptions (const char* Opt, const char* Arg)
static void OptDumpOptions (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the object file options */
{
What |= D_OPTIONS;
@ -157,7 +165,8 @@ static void OptDumpOptions (const char* Opt, const char* Arg)
static void OptDumpSegments (const char* Opt, const char* Arg)
static void OptDumpSegments (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Dump the segments in the object file */
{
What |= D_SEGMENTS;
@ -165,7 +174,8 @@ static void OptDumpSegments (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
{
Usage ();
@ -174,7 +184,8 @@ static void OptHelp (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the assembler version */
{
fprintf (stderr,

View File

@ -6,7 +6,7 @@
# Library dir
COMMON = ../common
CFLAGS = -O2 -g -Wall -W -Wno-unused-parameter -I$(COMMON)
CFLAGS = -O2 -g -Wall -W -I$(COMMON)
CC=gcc
EBIND=emxbind
LDFLAGS=