| Electronic Components Datasheet Search |
|
AN3350 Datasheet(PDF) 155 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3350 Datasheet(HTML) 155 Page - STMicroelectronics |
|
155 / 185 page ![]() AN3350 Pragmas for diagnostic messages Doc ID 018512 Rev 2 155/185 To prevent this warning, you can declare an argument in a few ways: ● Use the pragma unused, as in Example 108. Example 108 Using pragma unused() to prevent unused argument messages void func(int temp, int error) { #pragma unused (temp) /* Compiler does not warn that temp is not used. */ error=do_something(); } ● Do not give the unused argument a name.Example 109 shows an example. The compiler allows this feature in C++ source code. To allow this feature in C source code, disable ANSI strict checking. Example 109 Unused, unnamed arguments void func(int /* temp */, int error) { /* Compiler does not warn that "temp" is not used. */ error=do_something(); } By default, this pragma is off. 19.35 warn_unusedvar Controls the recognition of unreferenced variables. Syntax #pragma warn_unusedvar on | off | reset Remarks If you enable this pragma, the compiler issues a warning message when it encounters a variable you declare but do not use. This check helps you find variables that you either misspelled or did not use in your program.Example 110 shows an example. Example 110 Unused local variables example int error; void func(void) { int temp, errer; /* NOTE: errer is misspelled. */ error = do_something(); /* WARNING: temp and errer are unused. */ } If you want to use this warning but need to declare a variable that you do not use, include the pragma unused, as in Example 111. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |