Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 296703 Details for
Bug 395751
dev-embedded/msp430mcu - problem with macros and void functions
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
code to generate error messages
macro_problem_1220.c (text/plain), 1.74 KB, created by
David Relson
on 2011-12-23 01:07:11 UTC
(
hide
)
Description:
code to generate error messages
Filename:
MIME Type:
Creator:
David Relson
Created:
2011-12-23 01:07:11 UTC
Size:
1.74 KB
patch
obsolete
>// command: msp430-gcc -c -o macro_problem_1220.o macro_problem_1220 >// >// gives: macro_problem_1220:24:5: error: invalid use of void expression >// gives: macro_problem_1220:41:5: error: void value not ignored as it ought to be > >#include <msp430g2231.h> > >// following are #defines and prototypes involved in the error message >// msp430g2231.h:106:#define LPM0_bits (CPUOFF) >// msp430g2231.h:114:#define LPM0 _BIS_SR(LPM0_bits) /* Enter Low Power Mode 0 */ >// msp430g2231.h:121:#define LPM3_EXIT _BIC_SR_IRQ(LPM3_bits) /* Exit Low Power Mode 3 */ > >// intrinsics.h:140:#define _BIC_SR(_b) __bic_status_register(_b) >// intrinsics.h:142:#define _BIC_SR_IRQ(_b) __bic_status_register_on_exit(_b) >// intrinsics.h:142:#define __bis_SR_register(_b) __bis_status_register(_b) >// intrinsics.h:96:void __bis_status_register_on_exit (unsigned int bits); >// end of #defines and prototypes > >// *************************************************** >// macro_problem_1220:24:5: error: invalid use of void expression > >void Low_Power_Mode__Port_1(void) >{ > _BIC_SR(LPM3_EXIT); >} > >// analysis: >// >// LPM3_EXIT expands to a call to a void function, i.e. __bic_status_register_on_exit() >// this call is used as the parameter to _BIC_SR, i.e. to __bic_status_register >// >// question: >// >// is the return type of __bic_status_register incorrect? > >// *************************************************** >// macro_problem_1220:41:5: error: void value not ignored as it ought to be > >void Timer_Blink_LED__main(void) >{ > __bis_SR_register(LPM0 + GIE); // LPM0 with interrupts enabled >} > >// analysis: >// >// LPM0 expands to a call to a void function, i.e. __bic_status_register() >// GIE is added to the result of this call >// >// question: >// >// is the return type of __bic_status_register incorrect?
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 395751
: 296703