[MITgcm-devel] make depend exit status

Ed Hill ed at eh3.com
Thu May 22 22:29:55 EDT 2008


On Thu, 22 May 2008 21:46:55 -0400 Jean-Michel Campin wrote:

> Hi,
> 
> I discover that "make depend" (on linux FC ...) 
> can return an exit status of zero (as if everything was OK)
> even when some files are missing:
> 
> > makedepend -o .f -D .....(long list of .F files)
> > makedepend: warning:  land_mnc_init.F, line 42: cannot find include
> > file "mnc_common.h" not in mnc_common.h
> >         not in mnc_common.h
> >         not in /usr/include/netcdf-3/mnc_common.h
> >         not in /usr/include/mnc_common.h
> > ../../../tools/f90mkdepend >> Makefile
> > cat: mnc_common.h: No such file or directory
> > cat: mnc_common.h: No such file or directory
> > rm -f makedepend.out
> > danton{bld_g77}% echo $?
> > 0
> 
> And since testreport is checking the exit status of make depend,
> it will not catch this error and will return a
> 'make depend ...  successful'
> 
> Is this well know (except from me) or is it something unusual ?


Hi Jean-Michel,

From the message, it looks like the above makedepend implementation
considers the inability to locate the "mnc_common.h" file a "warning"
condition and not an an actual "error" or program-failure condition.

I'm not convinced that its the best choice but its also not an entirely
unreasonable choice from the standpoint of the makedepend implementer.
Parsing the C-preprocessor macros can be a mess.

And I agree that its annoying...!

Ed

ps - Some Unix/Linux utilities and shell scripts do a lot worse!
     They may fail with a zero return value or run correctly and 
     return a non-zero value.  I was fighting with a very similar 
     problem just a couple of weeks ago.  Sometimes there is no 
     substitute for inspection by human-developer eyeballs.  :-/

-- 
Edward H. Hill III, PhD  |  ed at eh3.com  |  http://eh3.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-devel/attachments/20080522/b8123a30/attachment.sig>


More information about the MITgcm-devel mailing list