Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[Fixed in 1.0.53+] Works but syntax warnings

A topic by COWCAT created Jul 23, 2021 Views: 388 Replies: 6
Viewing posts 1 to 4
(1 edit)

Hi,

With the latest GameMaker 2.3.3.574 I get a lot of "only referenced once" errors. Is that normal? The plugin itself seems to work though.

Also I'd like to point out that even though it's supposed to work with 2.3+, I couldn't get it to work with 2.3.1. (this time due to compiling errors) Hence I had to update to latest stable today.

Developer

As you can see, a handful of these are GameMaker complaining that you aren’t using every single function in the extension. I have trimmed down the number of these somewhat, but not all of these can be eliminated without additional work (as the code is auto-generated) or at all (array_set_2D is a built-in function, although a deprecated one)

(1 edit)

Hmm alright, no way to ignore the warnings then? I like to keep my syntax errors list empty.

It's strange that it considers functions as variables.

I guess I'll have to comment all these if that's the only solution...

Developer

You could make a script that assigns all of these names into a temporary variable and is never called - that’s how smart that warning is.

Good idea, I did this and was able to get rid of all warnings EXCEPT for one which is suspicious, l__g4.

According to the code:

if(l__g3.__enumIndex__==5)var l__g4=l__g3.h_d; else continue;

I don't see the point of initialising that local variable and doing nothing with it.

Developer

There are likely a few of these - Haxe compiler tends to preserve temporary variables when unpacking algebraic data types, and wiggling code around just so that it doesn’t do that is usually not worth it

The new release spots a GMLive_notOnce script which references all of the “single” identifiers so that GMS2 IDE can shut up about that.

Those aren’t errors, rather notices.