Re: how to test this piece of C code



subramanian100in@xxxxxxxxx, India said:

You have suggested to have MAX_BLOCK_LENGTH as #defined. I have a
question on this. If I declare it as a const size_t and initialize
with SIZE_MAX, won't it help in getting seen by the debugger or is
there any specific reason for using #define here ?

Whatever you think best. I know some people object to the use of the
preprocessor even for the simplest #defines, but I've never been one of
them.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.



Relevant Pages

  • Re: Is it that bad to initialize global variables at outside?
    ... > initialize global variables at outside of programs. ... > order to fullfil this, I had to declare them with const, but thereafter ... And if you're going to declare a global variable, ... usually makes sense to initialize it, ...
    (comp.lang.c)
  • Re: Setting pointer to null!
    ... I think this debugging fetaure emerged originally ... developer forgets to initialize a variable and it accidentally ... to declare a bunch that would be "initialized" in relatively distant code. ... because you prevent the compiler from initializing them ...
    (microsoft.public.vc.language)
  • Re: Tricking pl1s production_table
    ... you can have the compiler reference the debugging subroutine even ... display an automatic variable, and continue. ... declare float bin; ... on condition call debugger; ...
    (comp.sys.stratus)
  • Re: Differing function prototypes and definitions
    ... clients of this library might want to declare x as const in order to add some compile time checking to their code. ... Clearly, their doing this won't affect the library, nevertheless one compiler did issue a warning. ... I prefer the public prototype to be 'int32_t *const input_buffer' as it best describes the intention of the parameter, and matches similar APIs. ...
    (comp.lang.c)
  • Re: const pointer
    ... const char ch; ... "const", on the ... So the phrase "definition statement" is incorrec. ... The term "initialize" can be used informally to refer to assigning ...
    (comp.lang.c)