Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Different Lint Preprocessor
@ 2002-07-30 19:01 Joe Blow
  2002-07-31 11:01 ` Thomas Dickey
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Blow @ 2002-07-30 19:01 UTC (permalink / raw)


Currently the lint version on our Tru64 server (OSF1  V5.1 732)
supports 2 flags that control what lint uses for proprocessing source
code  cc, and cpp.

I would like to use neither, I would like to use gcc to preprocess our
code.  The cpp and cc methods of precompiling are not as featured as
gcc.

Is there an updated lint, or updated cpp/cc for this version of tru64
that we can use?   The specific bit of code that lint chews on is:

#define func(type, fmt, args...)    \
           func( type, __FUNCTION__, __LINE__, fmt, ## args)

Under GNU this is valid syntax, but alas under cc/cpp it is not
recognized and generates a tonne of warnings.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different Lint Preprocessor
  2002-07-30 19:01 Different Lint Preprocessor Joe Blow
@ 2002-07-31 11:01 ` Thomas Dickey
  2002-07-31 19:04   ` Paul Pluzhnikov
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Dickey @ 2002-07-31 11:01 UTC (permalink / raw)


Joe Blow <mrsincerity@hotmail.com> wrote:

> #define func(type, fmt, args...)    \
>            func( type, __FUNCTION__, __LINE__, fmt, ## args)

> Under GNU this is valid syntax, but alas under cc/cpp it is not
> recognized and generates a tonne of warnings.

yes, it's a shame that gcc has this bug, and that some people write
code that depends upon it.

-- 
Thomas E. Dickey <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different Lint Preprocessor
  2002-07-31 11:01 ` Thomas Dickey
@ 2002-07-31 19:04   ` Paul Pluzhnikov
  2002-08-01 10:00     ` Thomas Dickey
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Pluzhnikov @ 2002-07-31 19:04 UTC (permalink / raw)


Thomas Dickey <dickey@saltmine.radix.net> writes:

> Joe Blow <mrsincerity@hotmail.com> wrote:
> 
> > #define func(type, fmt, args...)    \
> >            func( type, __FUNCTION__, __LINE__, fmt, ## args)
> 
> > Under GNU this is valid syntax, but alas under cc/cpp it is not
> > recognized and generates a tonne of warnings.
> 
> yes, it's a shame that gcc has this bug, and that some people write
> code that depends upon it.

Especially given that you can achieve the same thing with
minimal increase in typing and still be standard-compliant:

  #if defined(__GNUC__)
    #define __HERE__ __FUNCTION__, __FILE__, __LINE__
  #else
    #define __HERE__ __FILE__, __LINE__
  #endif
  ...

     func(type, __HERE__, "%d %d", 1, 2);

Cheers,
-- 
In order to understand recursion you must first understand recursion.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different Lint Preprocessor
  2002-07-31 19:04   ` Paul Pluzhnikov
@ 2002-08-01 10:00     ` Thomas Dickey
  2002-08-05 14:21       ` Ed Vogel
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Dickey @ 2002-08-01 10:00 UTC (permalink / raw)


Paul Pluzhnikov <ppluzhnikov@earthlink.net> wrote:
> Thomas Dickey <dickey@saltmine.radix.net> writes:

>> Joe Blow <mrsincerity@hotmail.com> wrote:
>> > #define func(type, fmt, args...)    \
>> >            func( type, __FUNCTION__, __LINE__, fmt, ## args)

> Especially given that you can achieve the same thing with
> minimal increase in typing and still be standard-compliant:

>   #if defined(__GNUC__)
>     #define __HERE__ __FUNCTION__, __FILE__, __LINE__
>   #else
>     #define __HERE__ __FILE__, __LINE__
>   #endif
>   ...

>      func(type, __HERE__, "%d %d", 1, 2);

I didn't focus on the __FUNCTION__ keyword (as you note, not needed), but
on the ellipsis "..." which is used to implement a variable-argument list
in the C preprocessor.  (At one point someone was urging me to bundle the
GNU preprocessor with lynx so he could submit code that relied on this
feature ;-)

-- 
Thomas E. Dickey <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different Lint Preprocessor
  2002-08-01 10:00     ` Thomas Dickey
@ 2002-08-05 14:21       ` Ed Vogel
  0 siblings, 0 replies; 5+ messages in thread
From: Ed Vogel @ 2002-08-05 14:21 UTC (permalink / raw)



"Thomas Dickey" <dickey@saltmine.radix.net> wrote in message
news:aib0r2$mr6$2@news1.Radix.Net...
|| I didn't focus on the __FUNCTION__ keyword (as you note, not needed), but
| on the ellipsis "..." which is used to implement a variable-argument list
| in the C preprocessor.  (At one point someone was urging me to bundle the
| GNU preprocessor with lynx so he could submit code that relied on this
| feature ;-)
|

    It's true that the current version of Compaq C does not support this
    feature.  The next version of the Compaq C compiler does contain
    support for the C99 ellipsis operator in macros.   We expect this
    next version to be available soon.

    Note that as I understand it, the C99 version is slightly different
    than what gcc accepts.  For example the posted program will
    not compile unless a comma is added before the ...  The gcc
    compiler will accept either syntax, but C99 requires the comma.

                    Ed Vogel
                    Compaq C Engineering





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-08-05 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-30 19:01 Different Lint Preprocessor Joe Blow
2002-07-31 11:01 ` Thomas Dickey
2002-07-31 19:04   ` Paul Pluzhnikov
2002-08-01 10:00     ` Thomas Dickey
2002-08-05 14:21       ` Ed Vogel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox