.mod error | developer.brewmp.com .mod error | developer.brewmp.com

Developer

.mod error

Forums:

Hello guys...

does anybody knows why am I having this error? this error apears in the log from the .mod generator... but it generates the module...

warning: passing arg 8 of pointer to function makes integer from pointer without a cast

I'm using gnude arm compiler...

I've looked at the function and here it is:

IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, string, -1, 1, pMe->di.cyScreen - (pMe->fontHeight+1), &rc, NULL);

so... does anybody knows the problem??

thanks to all and hugs...

The last parameter of IDISPLAY_DrawText is not a pointer, but a uint32 containing flags. Therefore you passing NULL doesn't make much sense and that's what the compiler is warning you about. Check the doc of IDISPLAY_DrawText for more details.

The last parameter of IDISPLAY_DrawText is not a pointer, but a uint32 containing flags. Therefore you passing NULL doesn't make much sense and that's what the compiler is warning you about. Check the doc of IDISPLAY_DrawText for more details.

hello...
I've changed the last parameter and I still have the same error...
IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, string, -1, 1, pMe->di.cyScreen - (pMe->fontHeight+1), &rc, IDF_ALIGN_LEFT);
and the error is:
ibpilot2.c:537: warning: passing arg 8 of pointer to function makes integer from pointer without a cast
Do you think that this error is cause I'm using gnude??
hugs...
Vinícius Souza... :eek:

hello...
I've changed the last parameter and I still have the same error...
IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, string, -1, 1, pMe->di.cyScreen - (pMe->fontHeight+1), &rc, IDF_ALIGN_LEFT);
and the error is:
ibpilot2.c:537: warning: passing arg 8 of pointer to function makes integer from pointer without a cast
Do you think that this error is cause I'm using gnude??
hugs...
Vinícius Souza... :eek:

Oi Vinícius
It's just a warning, not an error... You might be able to get rid of it by casting the last argument to uint32. It seems to be getting confused because IDF_ALIGN_LEFT is a hex constant and gcc must think it's a pointer rather than an int.
I like to eliminate all warnings, but it's basically impossible with the ARM compiler.
Abraços

Oi Vinícius
It's just a warning, not an error... You might be able to get rid of it by casting the last argument to uint32. It seems to be getting confused because IDF_ALIGN_LEFT is a hex constant and gcc must think it's a pointer rather than an int.
I like to eliminate all warnings, but it's basically impossible with the ARM compiler.
Abraços

Quote:
I like to eliminate all warnings, but it's basically impossible with the ARM compiler.
You are right. There are certain warnings spit out by RVCT/ADS compiler can not be eliminated, however if you want to shut out all the warnings, you can use "-W". I prefer to use it at the end of of my development cycle, when I made sure that I eliminated all the meaningful warnings by modifying code.
ruben

Quote:
I like to eliminate all warnings, but it's basically impossible with the ARM compiler.
You are right. There are certain warnings spit out by RVCT/ADS compiler can not be eliminated, however if you want to shut out all the warnings, you can use "-W". I prefer to use it at the end of of my development cycle, when I made sure that I eliminated all the meaningful warnings by modifying code.
ruben

..or you can just write clean code. Most of my apps compile with ZERO WARNINGS in both ADS and VisualStudio Level 4.

..or you can just write clean code. Most of my apps compile with ZERO WARNINGS in both ADS and VisualStudio Level 4.

Wow, how did you get rid of these:
Warning: C2067I: option -zas will not be supported in future releases of the compiler
and
Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.)
The other ones are my own fault, since I insist on doing things that the ARM compiler doesn't like, e.g.:
Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'static_cast'
Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'reinterpret_cast'
Warning: C2220W: Superfluous ',' in 'enum' declaration
Warning: C2810W: (possible error): >= 10 lines of macro arguments
Warning: C2813W: Unrecognised #pragma or _Pragma message

Wow, how did you get rid of these:
Warning: C2067I: option -zas will not be supported in future releases of the compiler
and
Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.)
The other ones are my own fault, since I insist on doing things that the ARM compiler doesn't like, e.g.:
Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'static_cast'
Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'reinterpret_cast'
Warning: C2220W: Superfluous ',' in 'enum' declaration
Warning: C2810W: (possible error): >= 10 lines of macro arguments
Warning: C2813W: Unrecognised #pragma or _Pragma message

>>Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.)
That's a linker warning not a compiler warning and you can't get rid of it.
>>Warning: C2067I: option -zas will not be supported in future releases of the compiler
You're right I may not getting rid of that in ADS 1.1
As for the other warnign, yes they do indictae that you have a very poor programmign style. No offense, but it is evident from the warning that you are breaking some cardinal rules of "solid" C/C++ programming, especially C2813W and C2810W.

>>Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.)
That's a linker warning not a compiler warning and you can't get rid of it.
>>Warning: C2067I: option -zas will not be supported in future releases of the compiler
You're right I may not getting rid of that in ADS 1.1
As for the other warnign, yes they do indictae that you have a very poor programmign style. No offense, but it is evident from the warning that you are breaking some cardinal rules of "solid" C/C++ programming, especially C2813W and C2810W.

Yeah, those long macros aren't a good idea... but the pragma warning is caused by reminders like this:
#pragma message(__TODO__ "clean this up, kinda kludgy")
__TODO__ is another macro that does some stringizing trickery and prints __FILE__ and __LINE__ in the same format as a compiler warning so you can double-click it in the build window and go straight to that line of code in MSVC.
I guess you might say using non-standard pragmas is a cardinal sin... this one is so much fun... it must be hedonistic, for sure. :p

Yeah, those long macros aren't a good idea... but the pragma warning is caused by reminders like this:
#pragma message(__TODO__ "clean this up, kinda kludgy")
__TODO__ is another macro that does some stringizing trickery and prints __FILE__ and __LINE__ in the same format as a compiler warning so you can double-click it in the build window and go straight to that line of code in MSVC.
I guess you might say using non-standard pragmas is a cardinal sin... this one is so much fun... it must be hedonistic, for sure. :p

Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'static_cast'
Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'reinterpret_cast'
--- Which version of ARM compiler you are using? I use RVCT 1.2, these warnings are not there in the compiler documentation at all.
Warning: C2220W: Superfluous ',' in 'enum' declaration
--- ARM compiler does not like "," at the end of eum declaration. If you remove that it would compile fine.
Warning: C2810W: (possible error): >= 10 lines of macro arguments
---- If you choose to use multiple lines of macros, this warning cann't be eliminated. Your only option is using "-W"
Warning: C2813W: Unrecognised #pragma or _Pragma message
---- ARM compiler does not support pragma message, it supports limited set of pragma option. Anyway, you need this for emulator build. So if you wrap this one with #if defined (_MSVC) it would be fine.
ruben

Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'static_cast'
Warning: C2205W: Functionality of C++ keyword is not fully implemented: 'reinterpret_cast'
--- Which version of ARM compiler you are using? I use RVCT 1.2, these warnings are not there in the compiler documentation at all.
Warning: C2220W: Superfluous ',' in 'enum' declaration
--- ARM compiler does not like "," at the end of eum declaration. If you remove that it would compile fine.
Warning: C2810W: (possible error): >= 10 lines of macro arguments
---- If you choose to use multiple lines of macros, this warning cann't be eliminated. Your only option is using "-W"
Warning: C2813W: Unrecognised #pragma or _Pragma message
---- ARM compiler does not support pragma message, it supports limited set of pragma option. Anyway, you need this for emulator build. So if you wrap this one with #if defined (_MSVC) it would be fine.
ruben

I know why I'm getting the warning messages... I'm just being stubborn.
I also use RVCT 1.2. It's not in the docs that came with RVCT, but it is in this one: http://www.arm.com/support/ADS_Errors_and_Warnings.pdf
I'm using the casts correctly.
About the comma on the enum, yes it's because I did this: enum {
ALPHA = 100,
BRAVO,
CHARLIE,
};Yes, I could remove the comma after CHARLIE. Before I did BREW code, I got in the habit of leaving the comma, because I'd do this when adding new enums: enum {
ALPHA = 100,
BRAVO,
CHARLIE
DELTA,
ECHO
};(Forgetting the comma after CHARLIE.) Yeah, it's stupid. I don't think it's "very poor programming style," just different. It'd probably be better to do it the way I do initialization on ctors: enum {
ALPHA = 100
, BRAVO
, CHARLIE
};About wrapping all the pragma message statements with "#if defined (_MSVC)", yeah... ugh. At the beginning of a project, I sprinkle those statements all over. By the end of the project, they're all gone.
I get zero warnings in MSVC. I just had accepted that the ARM build would give warnings.

I know why I'm getting the warning messages... I'm just being stubborn.
I also use RVCT 1.2. It's not in the docs that came with RVCT, but it is in this one: http://www.arm.com/support/ADS_Errors_and_Warnings.pdf
I'm using the casts correctly.
About the comma on the enum, yes it's because I did this: enum {
ALPHA = 100,
BRAVO,
CHARLIE,
};Yes, I could remove the comma after CHARLIE. Before I did BREW code, I got in the habit of leaving the comma, because I'd do this when adding new enums: enum {
ALPHA = 100,
BRAVO,
CHARLIE
DELTA,
ECHO
};(Forgetting the comma after CHARLIE.) Yeah, it's stupid. I don't think it's "very poor programming style," just different. It'd probably be better to do it the way I do initialization on ctors: enum {
ALPHA = 100
, BRAVO
, CHARLIE
};About wrapping all the pragma message statements with "#if defined (_MSVC)", yeah... ugh. At the beginning of a project, I sprinkle those statements all over. By the end of the project, they're all gone.
I get zero warnings in MSVC. I just had accepted that the ARM build would give warnings.

Oh, in the RVCT 1.2 Compilers and Libraries Guide, appendix C.4 "Minor features of language support" (page C-5, table C-1) says this:
"New style casts Partial. RealView Compilation Tools for BREW C++ supports the syntax of new style casts, but does not enforce the restrictions. New style casts behave in the same manner as old style casts."

Oh, in the RVCT 1.2 Compilers and Libraries Guide, appendix C.4 "Minor features of language support" (page C-5, table C-1) says this:
"New style casts Partial. RealView Compilation Tools for BREW C++ supports the syntax of new style casts, but does not enforce the restrictions. New style casts behave in the same manner as old style casts."