src/oct-gperf.h enum values - with error messages

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

src/oct-gperf.h enum values - with error messages

Clinton Chee-2
Sorry, forgot to include error messages.
The messages are typically:


  cc-1491 CC: ERROR File = octave.gperf, Line = 96
   A template argument cannot reference an unnamed type.

          ^

       if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     MDiagArray2<Complex> &)"    &operator+=(MArray<double> &, const
MArray<double> &)"               ^


cc-1491 CC: ERROR File = octave.gperf, Line = 96
   A template argument cannot reference an unnamed type.


  "MDiagArray2<Complex>    ^


     if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)




  CC: ERROR File = octave.gperf, Line = 96
   A template argument cannot reference an unnamed type.


      ^
               ^


     if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)




                ^
&operator-=(MArray<Complex> &, const MArray<Complex> &)"

   detected during instantiation ofdetected during instantiation ofcc-1468




-------- Original Message --------
Subject: src/oct-gperf.h enum values
Resent-Date: Mon, 29 Nov 2004 21:15:23 -0600
Resent-From: [hidden email]
Date: Tue, 30 Nov 2004 14:09:06 +1100
From: Clinton Chee <[hidden email]>
To: [hidden email]

Dear Octave Maintainers

Why is there comilation problem for v 63 but not v 57 of Octave relating
to the file oct-gperf.h.

Specifically, oct-gperf.h defines a local "enum" structure like this:

enum
   {
     TOTAL_KEYWORDS = 37,
     MIN_WORD_LENGTH = 2,
     MAX_WORD_LENGTH = 22,
     MIN_HASH_VALUE = 2,
     MAX_HASH_VALUE = 75
   };



Later on in oct-gperf.h it uses the MAX/MIN_WORD_LENGTH like:

const struct octave_kw *
octave_kw_lookup (register const char *str, register unsigned int len)
{
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     {
       register int key = octave_kw_hash (str, len);



This causes problems when compiling but No More Problem if I replace
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
with
   if (len <= 22 && len >= 2)


I am using gperf 3.0.1 for both versions of Octave v57 and v63 but there
was no problem in the former.

Thanks in advance.

Cheers
Clinton









--


----------------------------------------------------------------------------
Clinton Chee
Computational Scientist
High Performance Computing Unit
Room 2075, Red Centre
University of New South Wales
Australia 2035
chee at parallel stop hpc stop unsw stop edu stop au
Tel: 61 2 9385 6915
----------------------------------------------------------------------------


--


----------------------------------------------------------------------------
Clinton Chee
Computational Scientist
High Performance Computing Unit
Room 2075, Red Centre
University of New South Wales
Australia 2035
chee at parallel stop hpc stop unsw stop edu stop au
Tel: 61 2 9385 6915
----------------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

src/oct-gperf.h enum values - with error messages

John W. Eaton-6
On 30-Nov-2004, Clinton Chee <[hidden email]> wrote:

| Sorry, forgot to include error messages.
| The messages are typically:
|
|
|   cc-1491 CC: ERROR File = octave.gperf, Line = 96
|    A template argument cannot reference an unnamed type.
|
|           ^
|
|        if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|      MDiagArray2<Complex> &)"    &operator+=(MArray<double> &, const
| MArray<double> &)"               ^
|
|
| cc-1491 CC: ERROR File = octave.gperf, Line = 96
|    A template argument cannot reference an unnamed type.
|
|
|   "MDiagArray2<Complex>    ^
|
|
|      if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
|
|
|
|   CC: ERROR File = octave.gperf, Line = 96
|    A template argument cannot reference an unnamed type.
|
|
|       ^
|                ^
|
|
|      if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
|
|
|
|                 ^
| &operator-=(MArray<Complex> &, const MArray<Complex> &)"
|
|    detected during instantiation ofdetected during instantiation ofcc-1468

Those lines seem badly wrapped.  Can you send the output in a way that
will preserve the spacing properly so it is clear what the ^
characters are pointing to?

What file is being compiled when the error occurs?  What is the
command line for the compiler?  I assume it must be lex.cc as that is
the only file that should include oct-gperf.h, but I don't see what
template instantiations would happen when compiling that file.

If you were using g++, I'd ask for a copy of the preprocessed source
(generated with the -save-temps option).  Is there an equivalent way
to generate the preprocessed source on your system with using
precisely the same options that are used for compiling?

jwe