Skip to content

Instantly share code, notes, and snippets.

@biggyspender
Created May 1, 2018 18:33
Show Gist options
  • Save biggyspender/785f10b0cc99604369f302782e9f1c28 to your computer and use it in GitHub Desktop.
Save biggyspender/785f10b0cc99604369f302782e9f1c28 to your computer and use it in GitHub Desktop.
void Main()
{
var makeOutput = @"ASM startup file ...Done.
.\make.exe : In file included from ../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rc
c.h:45:0,
At line:1 char:1
+ .\make.exe all 2>&1 > abc.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (In file include...hal_rcc.h:45:0,:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
from ../../../source/base/pro/inc/stm32f7xx_hal_conf.h:252,
from ../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal.h:46,
from ../../../source/base/pro/inc/main.h:4,
from ../../../source/base/pro/boot/main.cpp:50:
../../../source/base/pro/boot/main.cpp: In function 'int main()':
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc_ex.h:691:48: warning: conversion
to void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'
UNUSED(tmpreg); \
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h:83:27: note: in definition of m
acro 'UNUSED'
#define UNUSED(x) ((void)(x))
^
../../../source/base/pro/boot/main.cpp:100:2: note: in expansion of macro '__HAL_RCC_GPIOF_CLK_ENABLE'
__HAL_RCC_GPIOF_CLK_ENABLE();
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc_ex.h:651:48: warning: conversion
to void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'
UNUSED(tmpreg); \
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h:83:27: note: in definition of m
acro 'UNUSED'
#define UNUSED(x) ((void)(x))
^
../../../source/base/pro/boot/main.cpp:101:2: note: in expansion of macro '__HAL_RCC_GPIOA_CLK_ENABLE'
__HAL_RCC_GPIOA_CLK_ENABLE();
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/base/pro/boot/main.cpp: At global scope:
../../../source/base/pro/boot/main.cpp:150:1: error: 'sad' does not name a type
sad
^~~
In file included from ../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc.h:45:0,
from ../../../source/base/pro/inc/stm32f7xx_hal_conf.h:252,
from ../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal.h:46,
from ../../../source/base/pro/inc/main.h:4,
from ../../../source/base/pro/boot/main.cpp:50:
../../../source/base/pro/boot/main.cpp: In function 'void SystemClock_Config()':
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc.h:466:48: warning: conversion to
void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'
UNUSED(tmpreg); \
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h:83:27: note: in definition of m
acro 'UNUSED'
#define UNUSED(x) ((void)(x))
^
../../../source/base/pro/boot/main.cpp:231:5: note: in expansion of macro '__HAL_RCC_PWR_CLK_ENABLE'
__HAL_RCC_PWR_CLK_ENABLE();
^~~~~~~~~~~~~~~~~~~~~~~~
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_pwr.h:186:68: warning: conversion to
void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'
UNUSED(tmpreg); \
../../../dist/win/bin/ARMToolchain/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h:83:27: note: in definition of m
acro 'UNUSED'
#define UNUSED(x) ((void)(x))
^
../../../source/base/pro/boot/main.cpp:233:5: note: in expansion of macro '__HAL_PWR_VOLTAGESCALING_CONFIG'
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 100,0 % : C++ main.cpp ........................ Makefile:541: recipe for target 'obj/93_main.o' failed
make: *** [obj/93_main.o] Error 1";
string patternStr = @"([^:^\n]+):(\d+):(\d+):\s(\w+\s*\w*):\s(.+)\n(\s+)(.*)\s+\^+";
Regex regex = new Regex(patternStr, RegexOptions.Compiled);
Timing.Measure(() =>
{
MatchCollection match = regex.Matches(makeOutput);
var matches = match.Cast<Match>().ToList();
}, 3, 100).Dump();
}
public static class Timing
{
public static TimeSpan Measure(Action a, int warmupIters, int iters)
{
var allIters = new[] { warmupIters, iters };
Stopwatch sw = null;
foreach (var iterCount in allIters)
{
sw = Stopwatch.StartNew();
for (var i = 0; i < iterCount; ++i)
{
a();
}
}
return sw.Elapsed;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment