public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* const qualifier on function return types.
@ 2001-12-19 13:20 Lowell Johnson
  2001-12-19 13:20 ` Brian Gough
  2001-12-19 13:20 ` Brian Gough
  0 siblings, 2 replies; 5+ messages in thread
From: Lowell Johnson @ 2001-12-19 13:20 UTC (permalink / raw)
  To: gsl-discuss

Hello,

On IRIX using the MIPSPro C compiler, I get many warnings of the following
sort (GSL 0.7 -- 0.8, at least):

  cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O -s -n32 -mips3 -Wl,-woff,85 \
     -fullwarn -c cholesky.c
  ...
  cc-3303 cc: WARNING File = ../gsl/gsl_vector_double.h, Line = 78
    A type qualifier on a return type is meaningless.

    const gsl_vector gsl_vector_const_subvector (const gsl_vector *v,
                                                 size_t i, size_t n);
  ...

I do not get these warnings on Linux/gcc using the following command line:

  gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O -funsigned-char \
      -fwritable-strings -Wall -c cholesky.c

I searched the mailing list archive and saw a short discussion of this and
whether it is ANSI C.  I didn't see any mention of the reason for applying
the const qualifier.

What is the purpose of applying a const qualifier to a return value?  Is it
so that we can see the return value but not change it?

The library builds and works fine, but I would rather not have pages of
warnings in my applications that use the GSL.

Any suggestions?

Thanks.

-- Lowell

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

end of thread, other threads:[~2001-12-19 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 13:20 const qualifier on function return types Lowell Johnson
2001-12-19 13:20 ` Brian Gough
2001-12-19 13:20   ` Lowell Johnson
2001-12-19 13:20     ` Brian Gough
2001-12-19 13:20 ` Brian Gough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).