From 096bd0b633a4a5c9086faaf50a4e86afcfee542c Mon Sep 17 00:00:00 2001 From: paul moore Date: Fri, 29 Dec 2023 17:02:45 -0800 Subject: [PATCH 1/2] bug 2319 --- src/cl65/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cl65/main.c b/src/cl65/main.c index 553fb9ca6..cd245470a 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -1305,6 +1305,9 @@ static void OptStaticLocals (const char* Opt attribute ((unused)), static void OptTarget (const char* Opt attribute ((unused)), const char* Arg) /* Set the target system */ { + if (FirstInput) { + Error ("Target must be specified before input files"); + } Target = FindTarget (Arg); if (Target == TGT_UNKNOWN) { Error ("No such target system: '%s'", Arg); From c262929a626d4c191046da85c480513a6d109c5e Mon Sep 17 00:00:00 2001 From: paul moore Date: Sun, 31 Dec 2023 10:14:53 -0800 Subject: [PATCH 2/2] doc cl65 change --- doc/cl65.sgml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/cl65.sgml b/doc/cl65.sgml index 24d2f5927..f48e1353c 100644 --- a/doc/cl65.sgml +++ b/doc/cl65.sgml @@ -261,6 +261,9 @@ different options for different files on the command line. As an example. translates main.c with full optimization and module.c with less optimization and debug info enabled. +Note that the target system (-t , --target) must be specified before any file +unless using the default target of c64 + The type of an input file is derived from its extension: