[GRASS5] GRASS 5 and ANSI C

roger roger at spinn.net
Thu Oct 3 13:14:06 EDT 2002


Markus,

You can use the -ansi flag to force gcc to support full ANSI
features and to disable non-ANSI features.  If you then use
-pedantic the compiler will reject any code that is not ANSI
standard.  The error.log will contain a list of uncompiled
code.
If you redirect stderr to a file during compilation then
that file will give more details about the violations.

It would be nice if there were some way to get gcc to
convert non-ansi code to ansi code.  World peace and an end
to all famine and pestilence would be nice too.


Roger Miller

> Hi developers,
>
> Prof Giulio Antoniol (who published the clone detection
> for GRASS:
> http://mpa.itc.it/markus/grass_clones/index.html
> ) is also interested to perform some profiling analysis on
> the GRASS code.
> This helps to find out where/if time is spent/wasted in
> loops etc. E.g. the
> 'gprof' tool calculates the amount of time spent in each
> routine.
>
> Later we'll probably add some code (locally at IRST) to
> our GRASS version
> and check for several days/weeks, which functions are used
> and how time
> consuming they are (to find potential areas for code
> improvement).
>
> But: For the analysis the GRASS code must be ANSI C. It
> seems that
> there is still some K&R code existing....
> Since Giulio Antoniol is busy at time he asked me to
> 'stimulate' some
> code conversion :-)
>
> As I am not too confident with that, I would like to ask
>  - how we can identify K&R C coding style (any gcc
> tricks?)
>  - how we can (partially automated) update to ANSI C (ok,
> newbie question)?
>
> Thanks,
>
>  Markus
>
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
>




More information about the grass-dev mailing list