30.08.2007, 04:41 | #1 |
Участник
|
Issues concerning X++: Correction guide - Compiler warnings
Источник: http://blogs.msdn.com/x/archive/2007...-warnings.aspx
============== The following is based on material kindly provided by Michael Fruergaard Pontoppidan. I have edited it substantially and added some new material to make it fit within the context of this blog. Introduction This guide will show you how to resolve compiler warnings in Axapta. Compiler warnings are a strong indication that the code contains flaws or questionable constructs. The compiler groups the warnings in several levels according to the warning's severity: Level 1 is for very questionable issues, downto level 4 which are smaller issues. All compiler warnings must all be eliminated from production code to improve the overall code quality. Note that the Dynamics Ax development environment also features a best practise framework that diagnoses the code's adherence to the established best practises. The diagnostics issued by this tool are not covered here. Contents Introduction. Compiler Warnings Level 1. Break statement found outside legal context. The new method of a derived class does not call super(). The new method of a derived class may not call super(). Function never returns a value. Not all paths return a value. Assignment/Comparison loses precision. Compiler Warnings Level 2. Unreachable code. Compiler Warnings Level 3. Empty compound statement. Updating Views is not supported. Compiler Warnings Level 4. Class names should start with an uppercase letter. Member names should start with a lowercase letter. Compiler Warnings Level 1 Break statement found outside legal context Break statements are used to skip to the end of for, while, do-while and switch statements. If a break statement is encountered outside the body of one of these statements it is ignored at runtime and should be removed from the code to avoid confusion and improve legibility. Example 1: { 2: int i; 3: 4: for (i = 1; i
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|