Less verbose error output

Hi,

Using the web interface I’m having trouble identifying errors using the output after clicking “Verify”. Compared to what I’m used to in python or Arduino, the output is very general. For example, if I make a typo in a variable name on line 55 I get the following error output:

In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from Adafruit_Sensor.h:25,
from Adafruit_Sensor.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from Adafruit_Sensor.h:25,
from Adafruit_TSL2591.h:51,
from Adafruit_TSL2591.cpp:48:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
Adafruit_TSL2591.cpp: In member function 'uint32_t Adafruit_TSL2591::calculateLux(uint16_t, uint16_t)':
Adafruit_TSL2591.cpp:169:12: warning: unused variable 'chan0' [-Wunused-variable]
uint32_t chan0, chan1;
^
Adafruit_TSL2591.cpp:169:19: warning: unused variable 'chan1' [-Wunused-variable]
uint32_t chan0, chan1;
^
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from FreqPeriodCounter.h:15,
from FreqPeriodCounter.cpp:33:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from FreqPeriodCounter.cpp:33:0:
FreqPeriodCounter.h: In constructor 'FreqPeriodCounter::FreqPeriodCounter(byte, long unsigned int (*)(), unsigned int)':
FreqPeriodCounter.h:36:8: warning: 'FreqPeriodCounter::pin' will be initialized after [-Wreorder]
byte pin;
^
FreqPeriodCounter.h:34:12: warning: 'unsigned int FreqPeriodCounter::debounceTime' [-Wreorder]
unsigned debounceTime;
^
FreqPeriodCounter.cpp:35:1: warning: when initialized here [-Wreorder]
FreqPeriodCounter::FreqPeriodCounter(byte pin, unsigned long (*timeFunctionPtr)(), unsigned debounceTime):
^
In file included from ../inc/spark_wiring.h:29:0,
from OneWire/OneWire.h:8,
from OneWire/OneWire.cpp:131:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from OneWire/OneWire.cpp:131:0:
OneWire/OneWire.h:31:0: warning: "FALSE" redefined [enabled by default]
#define FALSE 0
^
In file included from ../../core-common-lib/CC3000_Host_Driver/cc3000_common.h:38:0,
from ../../core-common-lib/SPARK_Firmware_Driver/inc/hw_config.h:35,
from ../inc/main.h:37,
from ../inc/spark_utilities.h:30,
from ../inc/spark_wiring.h:33,
from OneWire/OneWire.h:8,
from OneWire/OneWire.cpp:131:
../../core-common-lib/CC3000_Host_Driver/data_types.h:53:0: note: this is the location of the previous definition
#define FALSE (0)
^
In file included from OneWire/OneWire.cpp:131:0:
OneWire/OneWire.h:32:0: warning: "TRUE" redefined [enabled by default]
#define TRUE 1
^
In file included from ../../core-common-lib/CC3000_Host_Driver/cc3000_common.h:38:0,
from ../../core-common-lib/SPARK_Firmware_Driver/inc/hw_config.h:35,
from ../inc/main.h:37,
from ../inc/spark_utilities.h:30,
from ../inc/spark_wiring.h:33,
from OneWire/OneWire.h:8,
from OneWire/OneWire.cpp:131:
../../core-common-lib/CC3000_Host_Driver/data_types.h:57:0: note: this is the location of the previous definition
#define TRUE (!FALSE)
^
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from pid/pid.cpp:13:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from Adafruit_Sensor.h:25,
from solar_tester.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from solar_tester.cpp:5:0:
OneWire/OneWire.h:31:0: warning: "FALSE" redefined [enabled by default]
#define FALSE 0
^
In file included from ../../core-common-lib/CC3000_Host_Driver/cc3000_common.h:38:0,
from ../../core-common-lib/SPARK_Firmware_Driver/inc/hw_config.h:35,
from ../inc/main.h:37,
from ../inc/spark_utilities.h:30,
from ../inc/spark_wiring.h:33,
from ../inc/application.h:29,
from Adafruit_Sensor.h:25,
from solar_tester.cpp:1:
../../core-common-lib/CC3000_Host_Driver/data_types.h:53:0: note: this is the location of the previous definition
#define FALSE (0)
^
In file included from solar_tester.cpp:5:0:
OneWire/OneWire.h:32:0: warning: "TRUE" redefined [enabled by default]
#define TRUE 1
^
In file included from ../../core-common-lib/CC3000_Host_Driver/cc3000_common.h:38:0,
from ../../core-common-lib/SPARK_Firmware_Driver/inc/hw_config.h:35,
from ../inc/main.h:37,
from ../inc/spark_utilities.h:30,
from ../inc/spark_wiring.h:33,
from ../inc/application.h:29,
from Adafruit_Sensor.h:25,
from solar_tester.cpp:1:
../../core-common-lib/CC3000_Host_Driver/data_types.h:57:0: note: this is the location of the previous definition
#define TRUE (!FALSE)
^
solar_tester.cpp: In function 'void RPM_counter_interrupt_service_routine()':
solar_tester.cpp:55:5: error: 'g_rPM_counter' was not declared in this scope

^
make: *** [solar_tester.o] Error 1

That’s 122 lines to go through, nearly all of it not applicable to my issue. Is there a way to turn the verbosity of the error output down? All I care about is one line:

solar_tester.cpp:55:5: error: 'g_rPM_counter' was not declared in this scope

Would I have to do local development to fix this?

Thanks

1 Like

I would copy and pasting the output into a text editor and doing a CTRL+F (find) for error. You have similar problems with local dev but you can turn off warnings

It would be nice if we could tick certain compiler flags. Given that we can turn off the preprocessor you might be able to supress warnings. I’ll look into it

1 Like

Local development is the same… same compiler that gives the same output…

There are many warnings in the output like unused variables or automatic conversions from int to unsigned int that would normally go unnoticed but may have an effect later on in your code

I normally find the if you start fixing the errors from the bottom up its easiest

1 Like

You can always squeltch warnings you don’t want to see with pragmas like so:

#pragma GCC diagnostic ignored "-Wunused-variable"

Thanks!
David

1 Like

You can’t do with with Web IDE or spark dev right? Any plans on releasing a completely local development environment? I tried following a guide on how to set one up, but some of the download links didn’t work. It would be awesome to have a single installer set the environment up for you ala Arduino IDE.

Another idea would be to have a GUI way of selecting the level out output in the Web IDE. Maybe “Info, Warnings, Errors”, “Warnings, Errors”, “Errors”. And color coded output. White, orange, and red respectively.

I’m fairly sure that’s in the roadmap. I would suggest you try to get a local dev running; it’s awesome one you get it running. What link didn’t work for you?

That’s great.

http://dfu-util.gnumonks.org/releases/

www.voidtools.com

Try here https://community.spark.io/t/dfu-util-binaries-while-dfu-util-gnumonks-org-is-down/8139

1 Like

Hi @waspinator,

Yes you can include those pragmas using the web ide, or the local spark dev ide. Single file installer (for openssl, dfu-util, and gcc / build essentials) is something we’d love for the future, but haven’t had a chance to get to yet. The cloud compiler is very helpful in those cases when you can’t / would rather not setup a local environment. The dfu-util guys have put their repo up on sourceforge ( dfu-util.sourceforge.net ) in the meantime while gnumonks is down.

Thanks,
David

1 Like