public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Problem building vector/reim_source.c
@ 2001-12-19 13:20 gsl-discuss
  2001-12-19 13:20 ` gsl-discuss
  0 siblings, 1 reply; 12+ messages in thread
From: gsl-discuss @ 2001-12-19 13:20 UTC (permalink / raw)
  To: gsl-discuss

I don't think this is legal C89 code (from vector/reim_source.c):

QUALIFIED_REAL_VIEW(gsl_vector, view)
FUNCTION(gsl_vector, real) (QUALIFIED_TYPE(gsl_vector) * v)
{
  REAL_TYPE(gsl_vector) s = NULL_VECTOR;

  s.data = v->data;
  s.size = v->size;
  s.stride = MULTIPLICITY * v->stride;
  s.block = 0;  /* FIXME: should be v->block, but cannot point to
                   block of different type */
  s.owner = 0;

  {
    QUALIFIED_REAL_VIEW(gsl_vector,view) view = NULL_VECTOR_VIEW;
    ((REAL_VIEW(gsl_vector,view) *)(&view))->vector = s;
    return view;
  }
}

The Solaris C compiler gives:

cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -mr -Qn -xstrconst -xO2
-xtarget=generic -c reim.c  -KPIC -DPIC -o reim.o
"./reim_source.c", line 35: left operand must be modifiable lvalue: op "="
"./reim_source.c", line 53: left operand must be modifiable lvalue: op "="
"./reim_source.c", line 35: left operand must be modifiable lvalue: op "="
"./reim_source.c", line 53: left operand must be modifiable lvalue: op "="
"./reim_source.c", line 35: left operand must be modifiable lvalue: op "="
"./reim_source.c", line 53: left operand must be modifiable lvalue: op "="
cc: acomp failed for reim.c

I don't believe you can cast an lvalue.

-- 
albert chin (china@thewrittenword.com)

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

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 13:20 Problem building vector/reim_source.c gsl-discuss
2001-12-19 13:20 ` gsl-discuss
2001-12-19 13:20   ` gsl-discuss
2001-12-19 13:20     ` Brian Gough
2001-12-19 13:20       ` gsl-discuss
2001-12-19 13:20         ` Brian Gough
2001-12-19 13:20           ` gsl-discuss
2001-12-19 13:20             ` Brian Gough
2001-12-19 13:20               ` gsl-discuss
2001-12-19 13:20                 ` Brian Gough
2001-12-19 13:20                   ` gsl-discuss
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).