g++ compilation fails when profiling enabled - g++

I have a working program, which I want to profile. Thus, I just added a -pg switch to the Makefile. This gives thousands of repetitions of this same message:
/tmp/ccOlI4CC.s:62095: Error: bad expression
/tmp/ccOlI4CC.s:62095: Error: junk `mcount#GOTPCREL(%rip)' after expression
/tmp/ccOlI4CC.s:62417: Error: bad expression
/tmp/ccOlI4CC.s:62417: Error: junk `mcount#GOTPCREL(%rip)' after expression
I'm in the blue. What can I do about this?

The problem was solved by removing the -masm=intel flag.

Related

i have a problem while using FreeRTOS with keil

i am using keil version 5 and i install all the packages that needed to run freeRTOS on it. but it always gives me an error with portmacro.h
here is some error lines:
C:/Users/Mohamed Radwan/AppData/Local/Arm/Packs/ARM/CMSIS-FreeRTOS/10.0.1/Source/portable/GCC/ARM_CM4F\portmacro.h(130): error: unknown type name 'inline'
C:/Users/Mohamed Radwan/AppData/Local/Arm/Packs/ARM/CMSIS-FreeRTOS/10.0.1/Source/portable/GCC/ARM_CM4F\portmacro.h(130): error: expected ';' after top level declarator
its repeated many times as there are many files using it.
any recommend what should i do ?

Error during cache:clear

When I run the php bon/console cache:clear I have this error :
Invalid resource provided: "1.2"; Errors: [ERROR 1843] Element '{urn:oasis:names:tc:xliff:document:1.2}trans-unit': Character content other than whitespace is not allowed because the content type is
'element-only'. (in /var/www/html/myproject/ - line 5, column 0)
I checked my xlf, files they look good, all the more I don't know witch one to check.
Any idea ?
Problem solved even if I did not exactly understood what was the problem.
I tried to reinstall all my vendors by removing my vendor folder and executing composer update
The error does not appear any more

Executing "db2look" in VB Excel - Getting Run-Time error: An unexpected "db2look" was found

I am trying to execute "db2look" command from within Excel using VB. But I'm getting Run-time Error
An unexpected token "db2look" was found following "BEGIN-OF-STATEMENT". Expected tokens include: "DECLARE". SQLSTATE=42601
I know connection and everything is fine, as I am able to run simple select queries and based on error it's not connection issue but rather like "db2look" not recognized or valid. I've ran same exact command in cmd window at it works fine.
Just wondering if anyone has been able to run the "db2look" command outside of db2 command window/editor and using VB/Excel? Or if there is something that I am missing.
Thanks
db2look is a tool and standalone executable which cannot be run like a regular SQL statement. It needs to be run from the command line (shell).

Parse issue Expected identifier or ')' in _types.h

Suddenly I'm getting an error in _types.h on the line with typedef. How can I track this down?
#ifdef __GNUC__
typedef __signed char __int8_t;
#else /* !__GNUC__ */
This is pretty much always caused by a syntax error just prior to whatever included the file with the actual error.
So, have a look in the file that (indirectly) included _types.h. You likely have an unbalanced (.
Usually these cryptic errors in system header files result from your having other code (perhaps in another header file which was #import'ed earlier) that is missing a closing parenthesis. Often whenever you get strange compile errors, you have to look at the lines of code that the compiler encountered before the reported line and see if that earlier code was properly terminated.

How to suppress warnings for 'void*' to 'foo*' conversions (reduced from errors by -fpermissive)

I'm trying to compile some c code with g++ (yes, on purpose). I'm getting errors like (for example):
error: invalid conversion from 'void*' to 'unsigned char*' [-fpermissive]
adding -fpermissive to the compilation options gets me:
error: invalid conversion from 'void*' to 'unsigned char*' [-Werror=permissive]
which seems to be a error because of -Werror, however adding -Wno-error=permissive -Wno-permissive results in:
error: -Werror=permissive: no option -Wpermissive
error: unrecognized command line option "-Wno-permissive" [-Werror]
How do I disable warnings (globaly) for conversions from void* to other pointer types?
You cannot "disable warnings for conversions from void* to other pointer types" because this is not a warning - it is a syntax error.
What's happening here is that you are using -fpermissive which downgrades some errors - including this one - to warnings, and therefore allows you to compile some non-conforming code (obviously many types of syntax errors, such as missing braces, cannot be downgraded to warnings since the compiler cannot know how to fix them to turn them into understandable code).
Then, you are also using -Werror which upgrades all warnings to errors, including the "warnings" that -fpermissive has turned your error into.
-Wno-error is used only to negate -Werror, i.e. it causes -Werror to treat all warnings as errors except the warnings specified with -Wno-error, which remain as warnings. As the -W flag suggests, both these flags work with warnings, so they can't do anything with this particular issue, since what you have here is an error. There is no "warning" for this kind of invalid conversion that you can switch off and on with -Werror because it's not a real warning - it's an error that -fpermissive is merely causing to be treated as a warning.
You can compile your non-comforming code, in this case, by using -fpermissive and not using -Werror. This will still give you a warning, but like all warnings, it won't prevent successful compilation. If you are deliberately trying to compile non-conforming code, then using -Werror makes no sense, because you know your code contains errors and will therefore result in warnings, even with -fpermissive, so specifying -Werror is equivalent to saying "please do not compile my non-conforming code, even though I've just asked you to."
The furthest you can go to get g++ to suppress warnings is to use -fsyntax-only which will check for syntax errors and nothing else, but since what you have here is a syntax error, that won't help you, and the best you can do is have that turned into a warning by -fpermissive.
How do I disable warnings (globaly) for conversions from void* to
other pointer types?
Well it might require direct interaction with compiler's code. This is probably not what you want. You want to fix your code. First, these are not warnings but errors. You need to cast void* as you can not convert a void* to anything without casting it first (it is possible in C however which is less type safe as C++ is).
For example you would need to do
void* buffer = operator new(100);
unsigned char* etherhead = static_cast<unsigned char*>(buffer);
^
cast
If you want a dynamically allocated buffer of 100 unsigned char then you are better off doing this
unsigned char* p = new unsigned char[100];
and avoiding the cast.
void pointers