View previous topic :: View next topic |
Author |
Message |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Fri Jun 08, 2012 4:32 pm Post subject: Programming question |
|
|
This is a general programming question not a fortran question.Can anyone help?
Please can anyone explain me the ,menaing of this statement?
Are function parameters explicitly verified in the code?
Can anyone explain through an example? I was eading a check list for a good code and found this.
Christy |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Fri Jun 08, 2012 10:20 pm Post subject: |
|
|
I suspect it means that you should use a language or compiler that is capable of checking function arguments are used correctly. It is always good practice to get the compiler to check this if you can. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sat Jun 09, 2012 2:52 am Post subject: |
|
|
This could also be from a list of things to be done when coding a function, eg does ASIN have code to check if the argument is in the range -1 to +1, otherwise report an error. Asks the question : How should a function report an error ? |
|
Back to top |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Sat Jun 09, 2012 8:20 am Post subject: |
|
|
Could this mean the following?
I have a function with x number of arguments.
SO, the programmer should debug and see that every argument has a realistic value.It might so happen that he might have sent arguments to the function from the calling routine which are not used in the function and hence have junk values as they are not declared.
Could this also be an interpretation of that sentence:
Quote: | Are function parameters explicitly verified in the code? |
Christy |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sun Jun 10, 2012 5:34 am Post subject: |
|
|
People mostly answered your question but you can try to find more answers in this table which summarizes what compilers check in subroutines and functions.
http://www.polyhedron.com/pb05-win32-diagnose0html |
|
Back to top |
|
 |
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: N�rnberg, Germany
|
Posted: Sun Jun 10, 2012 10:48 am Post subject: |
|
|
Very interesting presentation of the available compilers! When it comes to checking FTN95 is the best - and this is may experience as well. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sun Jun 10, 2012 9:16 pm Post subject: |
|
|
... and if Polyhedron printed the compile time, that might be an interesting statistic. |
|
Back to top |
|
 |
|