Warnings are preventing me from uploading my sketch to my Arduino NANA

Arduino: 1.8.12 (Windows 10), Board: "Arduino Nano, ATmega328P"

sketch_jun12a:99:1: error: expected unqualified-id before '-' token

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino: In function 'void loop()':

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:150:30: warning: invalid conversion from 'const uint8_t ()[8] {aka const unsigned char ()[8]}' to 'short int' [-fpermissive]

drawImage(mouth_smile);

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:84:6: note: initializing argument 1 of 'void drawImage(short int)'

void drawImage(short image_addr){

^~~~~~~~~

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:152:26: warning: invalid conversion from 'const uint8_t ()[8] {aka const unsigned char ()[8]}' to 'short int' [-fpermissive]

drawImage(mouth_0);

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:84:6: note: initializing argument 1 of 'void drawImage(short int)'

void drawImage(short image_addr){

^~~~~~~~~

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:154:26: warning: invalid conversion from 'const uint8_t ()[8] {aka const unsigned char ()[8]}' to 'short int' [-fpermissive]

drawImage(mouth_1);

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:84:6: note: initializing argument 1 of 'void drawImage(short int)'

void drawImage(short image_addr){

^~~~~~~~~

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:156:26: warning: invalid conversion from 'const uint8_t ()[8] {aka const unsigned char ()[8]}' to 'short int' [-fpermissive]

drawImage(mouth_2);

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:84:6: note: initializing argument 1 of 'void drawImage(short int)'

void drawImage(short image_addr){

^~~~~~~~~

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:158:26: warning: invalid conversion from 'const uint8_t ()[8] {aka const unsigned char ()[8]}' to 'short int' [-fpermissive]

drawImage(mouth_3);

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:84:6: note: initializing argument 1 of 'void drawImage(short int)'

void drawImage(short image_addr){

^~~~~~~~~

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:160:26: warning: invalid conversion from 'const uint8_t ()[8] {aka const unsigned char ()[8]}' to 'short int' [-fpermissive]

drawImage(mouth_4);

^

C:\Users\alexander\Documents\Arduino\sketch_jun12a\sketch_jun12a.ino:84:6: note: initializing argument 1 of 'void drawImage(short int)'

void drawImage(short image_addr){

^~~~~~~~~

exit status 1
expected unqualified-id before '-' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

These are the warning that show up when I try to upload it to the NANO
this is not my code I sore a guy who had created a face mask that moves a LED (8x8) via a mic when u speak through a mask. I have also got into contact with the creator showing him the same warnings above. he told me that they were warnings not errors and it shouldn't stop the code from uploading. However it does not upload. I have tried uploading a basic sketch from the Arduino examples where the red light blinks and it worked. If there are any other information please leave a comment and ill reply ASAP. Thank you

Warnings will not prevent compiling and upload. However errors will. The "expected unqualified-id before '-' token" is an error. If we could see the code we could help you fix the error. Without seeing the code, you are on your own.

Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask an effective question. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

sketch_jun12a:99:1: error: expected unqualified-id before '-' token

 -

 ^

Looks like the problem is in or near line 99: a line containing a single '-'.

i'd actually like the IDE to not upload/run programs if there is an error.

what option did I touch that allows this?

gcjr:
i'd actually like the IDE to not upload/run programs if there is an error.

what option did I touch that allows this?

The IDE does not upload if there is an error. Are you perhaps thinking of warnings?

It is possible to upgrade warnings to errors using the -Werror option. The ESP32 boards platform developers came up with the innovation of adding the -Werror option when you set the File > Preferences > Compiler warnings option to "More" or "All". I think this has resulted in the ESP32 code having less warnings, but also some confusion for the users. You can add the -Werror option to boards platforms if you like. The best way to do this is typically to create a file named platform.local.txt that contains this:

compiler.c.extra_flags=-Werror
compiler.cpp.extra_flags=-Werror

then place that file in the same folder as each platform's platform.txt file (I can provide instructions for finding that folder if you like).