Click here to Skip to main content

Shao Voon Wong - Professional Profile





Summary

    Blog RSS
54,086
Author
1,085
Authority
1,892
Debator
709
Editor
30
Enquirer
612
Organiser
3,135
Participant
No Biography provided
  • 30 Mar 2012: Best C++ article of February 2012
  • 26 Oct 2009: Best C++/MFC article of Sep 2009

 

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an ArticlesilversilversilversilverSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending QuestiongoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending AnswergoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Approve/Disapprove a pending Forum MessagegoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
General[coderant] Zero warnings : An ideal? [modified] PinmemberCBasicNet17-Mar-08 0:15 
Some coding books advocate zero warnings at the highest warnings level setting. Is this possible? I think not. I have seen some people resolved “conversion from 'double' to 'float'” warning by doing a float cast. They could have solved this problem by using all floats or all doubles, however we do use libraries and we do not have control over these libraries, especially third party libraries. For example,
 
float m_f;
m_f = (float *)a_double;

 
The problem is by doing a cast, you are silencing the compiler by saying, “yes I know it is wrong but I am very sure a_double's value will not exceed a float max value.” On closer examination of the class , it only has 2 float member variables and all the casting from double are to be assigned to these 2 member variables. So the more correct way to solve this problem is make these 2 variables to be double type. Anyway, converting 2 floats(32 bits type) into 2 doubles(64 bits type), you only increase the memory requirement by 8 bytes. It is also much simpler than adding all the castings which need to be there.
 
So the correct way of solving the “conversion from double to float”, “conversion from int to short” and “< : signed/unsigned mismatch” is to change the type of variable to match the other type. For example,
 
// Wrong way
for( int i=0; i<(int)vec.size(); ++i ) {
....
}
 
// Correct way: size_t is the same unsigned type as vec.size() returns
for( size_t i=0; i<vec.size(); ++i ) {
....
}

 
If you use casting to resolve these type mismatch warning, you might as well use pragmas to silence the warnings, that is what pragmas are used for! When something has gone wrong and you cannot figure it out why, you can remove the pragmas and re-enable the warnings back. With casting, you can't!
 
Zero warnings to me, is an “hard to achieve” ideal because things are not always clear cut. I will always try my best to reduce warnings to the minimum, but I would rather leave some unresolvable warnings there, so that I know where to look if something goes wrong.

modified 18-Aug-13 4:44am.

GeneralRe: [coderant] Zero warnings : An ideal? Pinmember Vasudevan Deepak K17-Mar-08 1:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 20 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid