Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #65739 > unrolled thread
| Started by | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| First post | 2015-07-17 02:36 +0200 |
| Last post | 2015-07-17 20:11 -0700 |
| Articles | 20 on this page of 64 — 22 participants |
Back to article view | Back to comp.lang.c
Error messages jacobnavia <jacob@jacob.remcomp.fr> - 2015-07-17 02:36 +0200
Re: Error messages Richard Heathfield <rjh@cpax.org.uk> - 2015-07-17 01:51 +0100
Re: Error messages Keith Thompson <kst-u@mib.org> - 2015-07-16 18:24 -0700
Re: Error messages Lőrinczy Zsigmond <nospam@for.me> - 2015-07-17 09:31 +0200
Re: Error messages Richard Heathfield <rjh@cpax.org.uk> - 2015-07-17 08:35 +0100
Re: Error messages glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-07-17 09:11 +0000
Re: Error messages Richard Heathfield <rjh@cpax.org.uk> - 2015-07-17 10:30 +0100
Re: Error messages Ian Collins <ian-news@hotmail.com> - 2015-07-17 21:44 +1200
Re: Error messages Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-17 12:55 +0100
Re: Error messages Melzzzzz <mel@zzzzz.com> - 2015-07-17 19:53 +0200
Re: Error messages glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-07-17 17:55 +0000
Re: Error messages James Kuyper <jameskuyper@verizon.net> - 2015-07-17 14:19 -0400
Re: Error messages raltbos@xs4all.nl (Richard Bos) - 2015-07-19 21:44 +0000
Re: Error messages gazelle@shell.xmission.com (Kenny McCormack) - 2015-07-17 07:38 +0000
Re: Error messages Noob <root@127.0.0.1> - 2015-07-17 09:58 +0200
Re: Error messages gazelle@shell.xmission.com (Kenny McCormack) - 2015-07-17 13:32 +0000
Re: Error messages Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-18 11:13 +0100
Re: Error messages James Kuyper <jameskuyper@verizon.net> - 2015-07-16 22:36 -0400
Re: Error messages Reinhardt Behm <rbehm@hushmail.com> - 2015-07-17 13:05 +0800
Re: Error messages jacobnavia <jacob@jacob.remcomp.fr> - 2015-07-17 09:48 +0200
Re: Error messages David Kleinecke <dkleinecke@gmail.com> - 2015-07-17 19:23 -0700
Re: Error messages Keith Thompson <kst-u@mib.org> - 2015-07-17 21:24 -0700
Re: Error messages David Kleinecke <dkleinecke@gmail.com> - 2015-07-18 18:29 -0700
Re: Error messages Keith Thompson <kst-u@mib.org> - 2015-07-18 20:59 -0700
Re: Error messages David Kleinecke <dkleinecke@gmail.com> - 2015-07-19 19:22 -0700
Re: Error messages David Brown <david.brown@hesbynett.no> - 2015-07-21 11:40 +0200
Compiler conformance (Was: Error messages) gazelle@shell.xmission.com (Kenny McCormack) - 2015-07-21 11:40 +0000
Re: Compiler conformance Noob <root@127.0.0.1> - 2015-07-21 14:01 +0200
Re: Compiler conformance gazelle@shell.xmission.com (Kenny McCormack) - 2015-07-21 13:47 +0000
Re: Error messages Reinhardt Behm <rbehm@hushmail.com> - 2015-07-18 13:38 +0800
Re: Error messages Keith Thompson <kst-u@mib.org> - 2015-07-17 07:54 -0700
Re: Error messages raltbos@xs4all.nl (Richard Bos) - 2015-07-19 22:00 +0000
Re: Error messages Richard Damon <Richard@Damon-Family.org> - 2015-07-19 19:47 -0400
Re: Error messages jacobnavia <jacob@jacob.remcomp.fr> - 2015-07-17 10:06 +0200
Re: Error messages Bartc <bc@freeuk.com> - 2015-07-17 12:07 +0100
Re: Error messages Noob <root@127.0.0.1> - 2015-07-17 13:14 +0200
Re: Error messages Bartc <bc@freeuk.com> - 2015-07-17 12:40 +0100
Re: Error messages gwowen <gwowen@gmail.com> - 2015-07-17 04:32 -0700
Re: Error messages jacobnavia <jacob@jacob.remcomp.fr> - 2015-07-17 14:15 +0200
Re: Error messages gwowen <gwowen@gmail.com> - 2015-07-17 05:25 -0700
Re: Error messages Bartc <bc@freeuk.com> - 2015-07-17 13:34 +0100
Re: Error messages Keith Thompson <kst-u@mib.org> - 2015-07-17 08:07 -0700
Re: Error messages jacobnavia <jacob@jacob.remcomp.fr> - 2015-07-17 14:38 +0200
Re: Error messages Martin Shobe <martin.shobe@yahoo.com> - 2015-07-17 08:50 -0500
Re: Error messages jacobnavia <jacob@jacob.remcomp.fr> - 2015-07-17 16:08 +0200
Re: Error messages Martin Shobe <martin.shobe@yahoo.com> - 2015-07-17 09:24 -0500
Re: Error messages James Kuyper <jameskuyper@verizon.net> - 2015-07-17 12:26 -0400
Re: Error messages Martin Shobe <martin.shobe@yahoo.com> - 2015-07-17 13:19 -0500
Re: Error messages James Kuyper <jameskuyper@verizon.net> - 2015-07-17 14:28 -0400
Re: Error messages James Kuyper <jameskuyper@verizon.net> - 2015-07-17 14:43 -0400
Re: Error messages Bartc <bc@freeuk.com> - 2015-07-17 20:31 +0100
Re: Error messages Martin Shobe <martin.shobe@yahoo.com> - 2015-07-18 08:41 -0500
Re: Error messages David Brown <david.brown@hesbynett.no> - 2015-07-21 12:25 +0200
Re: Error messages James Kuyper <jameskuyper@verizon.net> - 2015-07-21 13:20 -0400
Re: Error messages David Brown <david.brown@hesbynett.no> - 2015-07-22 00:05 +0200
Re: Error messages Noob <root@127.0.0.1> - 2015-07-17 16:16 +0200
Re: Error messages doctor@doctor.nl2k.ab.ca (The Doctor) - 2015-07-17 14:49 +0000
Re: Error messages Noob <root@127.0.0.1> - 2015-07-17 20:02 +0200
Re: Error messages The Doctor <doctor@doctor.nl2k.ab.ca> - 2015-07-17 22:24 +0000
Re: Error messages Noob <root@127.0.0.1> - 2015-07-20 10:46 +0200
Re: Error messages doctor@doctor.nl2k.ab.ca (The Doctor) - 2015-07-20 14:59 +0000
Re: Error messages Keith Thompson <kst-u@mib.org> - 2015-07-17 08:25 -0700
Re: Error messages raltbos@xs4all.nl (Richard Bos) - 2015-07-19 22:07 +0000
Re: Error messages Ed Prochak <edprochak@gmail.com> - 2015-07-17 20:11 -0700
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
| From | Bartc <bc@freeuk.com> |
|---|---|
| Date | 2015-07-17 13:34 +0100 |
| Message-ID | <moasm7$79u$1@dont-email.me> |
| In reply to | #65774 |
On 17/07/2015 13:25, gwowen wrote:
> On Friday, July 17, 2015 at 1:15:58 PM UTC+1, jacobnavia wrote:
>> Le 17/07/2015 13:32, gwowen a écrit :
>>> On Friday, July 17, 2015 at 1:36:54 AM UTC+1, jacobnavia wrote:
>>>> This will cost me around 1 day development, and 1 day testing. Is that
>>>> still possible for gcc and c++?
>>>
>>> I think its already been done!
>>
>> Then why do not do it for C++?
>
> Huh?
>
>> You see?
>
> No.
>
> foo.cpp:3:3: error: 'TYPE' was not declared in this scope
> TYPE t;
> ^
>
> seems pretty unambiguous to me.
Your choice of type name makes the error appear more apt than it
actually is. Try:
foo.cpp:3:3: error: 'SAUSAGE' was not declared in this scope
SAUSAGE t;
^
--
Bartc
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-07-17 08:07 -0700 |
| Message-ID | <ln380mkek0.fsf@kst-u.example.com> |
| In reply to | #65775 |
Bartc <bc@freeuk.com> writes:
> On 17/07/2015 13:25, gwowen wrote:
>> On Friday, July 17, 2015 at 1:15:58 PM UTC+1, jacobnavia wrote:
>>> Le 17/07/2015 13:32, gwowen a écrit :
>>>> On Friday, July 17, 2015 at 1:36:54 AM UTC+1, jacobnavia wrote:
>>>>> This will cost me around 1 day development, and 1 day testing. Is that
>>>>> still possible for gcc and c++?
>>>>
>>>> I think its already been done!
>>>
>>> Then why do not do it for C++?
>>
>> Huh?
>>
>>> You see?
>>
>> No.
>>
>> foo.cpp:3:3: error: 'TYPE' was not declared in this scope
>> TYPE t;
>> ^
>>
>> seems pretty unambiguous to me.
>
> Your choice of type name makes the error appear more apt than it
> actually is. Try:
>
> foo.cpp:3:3: error: 'SAUSAGE' was not declared in this scope
> SAUSAGE t;
> ^
Perhaps you're using an older version of gcc.
$ gcc --version | head -1
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
$ cat c.c
sausage s;
$ gcc -c c.c
c.c:1:1: error: unknown type name 'sausage'
sausage s;
^
$ cp c.c c.cpp
$ g++ -c c.cpp
c.cpp:1:1: error: 'sausage' does not name a type
sausage s;
^
$
Having the compiler guess that it's a type name is nice, but not IMHO
essential.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-07-17 14:38 +0200 |
| Message-ID | <moassq$810$1@dont-email.me> |
| In reply to | #65774 |
Le 17/07/2015 14:25, gwowen a écrit : > On Friday, July 17, 2015 at 1:15:58 PM UTC+1, jacobnavia wrote: >> Le 17/07/2015 13:32, gwowen a écrit : >>> On Friday, July 17, 2015 at 1:36:54 AM UTC+1, jacobnavia wrote: >>>> This will cost me around 1 day development, and 1 day testing. Is that >>>> still possible for gcc and c++? >>> >>> I think its already been done! >> >> Then why do not do it for C++? > > Huh? > >> You see? > > No. > > foo.cpp:3:3: error: 'TYPE' was not declared in this scope > TYPE t; > ^ > > seems pretty unambiguous to me. > This whole discussion started with "Doctor" telling us that gcc wrote: /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error before >' token See thread "SQL filesortcc question" Apparently gcc does it for C, but for C++ it is not possible.
[toc] | [prev] | [next] | [standalone]
| From | Martin Shobe <martin.shobe@yahoo.com> |
|---|---|
| Date | 2015-07-17 08:50 -0500 |
| Message-ID | <mob14k$mom$1@dont-email.me> |
| In reply to | #65776 |
On 7/17/2015 7:38 AM, jacobnavia wrote: > Le 17/07/2015 14:25, gwowen a écrit : >> On Friday, July 17, 2015 at 1:15:58 PM UTC+1, jacobnavia wrote: >>> Le 17/07/2015 13:32, gwowen a écrit : >>>> On Friday, July 17, 2015 at 1:36:54 AM UTC+1, jacobnavia wrote: >>>>> This will cost me around 1 day development, and 1 day testing. Is that >>>>> still possible for gcc and c++? >>>> >>>> I think its already been done! >>> >>> Then why do not do it for C++? >> >> Huh? >> >>> You see? >> >> No. >> >> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >> TYPE t; >> ^ >> >> seems pretty unambiguous to me. >> > > This whole discussion started with "Doctor" telling us that gcc wrote: > > /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error before > >' token > > See thread "SQL filesortcc question" > > Apparently gcc does it for C, but for C++ it is not possible. The example he gave for gcc "doing it" was for C++. Martin Shobe
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-07-17 16:08 +0200 |
| Message-ID | <mob266$rd0$1@dont-email.me> |
| In reply to | #65779 |
Le 17/07/2015 15:50, Martin Shobe a écrit : >> >> Apparently gcc does it for C, but for C++ it is not possible. > > The example he gave for gcc "doing it" was for C++. > > Martin Shobe > No. It just gave a "parse error", not a meaningful message like in C.
[toc] | [prev] | [next] | [standalone]
| From | Martin Shobe <martin.shobe@yahoo.com> |
|---|---|
| Date | 2015-07-17 09:24 -0500 |
| Message-ID | <mob352$us8$1@dont-email.me> |
| In reply to | #65780 |
On 7/17/2015 9:08 AM, jacobnavia wrote:
> Le 17/07/2015 15:50, Martin Shobe a écrit :
>>>
>>> Apparently gcc does it for C, but for C++ it is not possible.
>>
>> The example he gave for gcc "doing it" was for C++.
>>
>> Martin Shobe
>>
>
> No. It just gave a "parse error", not a meaningful message like in C.
Pay attention. The error message for C++ was the one below. It's the
same message as the C one, differing only by the file name.
foo.cpp: In function 'int main()':
foo.cpp:3:3: error: 'TYPE' was not declared in this scope
TYPE t;
^
Martin Shobe
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2015-07-17 12:26 -0400 |
| Message-ID | <55A92CAB.3000203@verizon.net> |
| In reply to | #65782 |
On 07/17/2015 10:24 AM, Martin Shobe wrote: > On 7/17/2015 9:08 AM, jacobnavia wrote: >> Le 17/07/2015 15:50, Martin Shobe a écrit : >>>> >>>> Apparently gcc does it for C, but for C++ it is not possible. >>> >>> The example he gave for gcc "doing it" was for C++. >>> >>> Martin Shobe >>> >> >> No. It just gave a "parse error", not a meaningful message like in C. > > Pay attention. The error message for C++ was the one below. It's the > same message as the C one, differing only by the file name. > > foo.cpp: In function 'int main()': > foo.cpp:3:3: error: 'TYPE' was not declared in this scope > TYPE t; > ^ You're the one not paying attention. The error message jacob is rightfully complaining about was generated by g++ 3.2.3 for the following code: *buf= std::get_temporary_buffer<type>(size); The error message itself was: /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error before `>' token and, as we now know, was caused by the absence of #include <message> So, at least in that version of g++, the improved error message you described above had not yet been implemented.
[toc] | [prev] | [next] | [standalone]
| From | Martin Shobe <martin.shobe@yahoo.com> |
|---|---|
| Date | 2015-07-17 13:19 -0500 |
| Message-ID | <mobgrv$ind$1@dont-email.me> |
| In reply to | #65790 |
On 7/17/2015 11:26 AM, James Kuyper wrote: > On 07/17/2015 10:24 AM, Martin Shobe wrote: >> On 7/17/2015 9:08 AM, jacobnavia wrote: >>> Le 17/07/2015 15:50, Martin Shobe a écrit : >>>>> >>>>> Apparently gcc does it for C, but for C++ it is not possible. >>>> >>>> The example he gave for gcc "doing it" was for C++. >>> No. It just gave a "parse error", not a meaningful message like in C. >> >> Pay attention. The error message for C++ was the one below. It's the >> same message as the C one, differing only by the file name. >> >> foo.cpp: In function 'int main()': >> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >> TYPE t; >> ^ > > You're the one not paying attention. I'm aware of the original error message. However, Jacob used gwowen's examples as evidence that gcc did produce the type of error messages for C code that was "impossible" to produce for C++. Clearly he missed the fact that gwowen also showed C++ code where gcc produced the "impossible" error message. Martin Shobe
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2015-07-17 14:28 -0400 |
| Message-ID | <55A9496A.5050304@verizon.net> |
| In reply to | #65797 |
On 07/17/2015 02:19 PM, Martin Shobe wrote: > On 7/17/2015 11:26 AM, James Kuyper wrote: >> On 07/17/2015 10:24 AM, Martin Shobe wrote: >>> On 7/17/2015 9:08 AM, jacobnavia wrote: >>>> Le 17/07/2015 15:50, Martin Shobe a écrit : >>>>>> >>>>>> Apparently gcc does it for C, but for C++ it is not possible. >>>>> >>>>> The example he gave for gcc "doing it" was for C++. > >>>> No. It just gave a "parse error", not a meaningful message like in C. >>> >>> Pay attention. The error message for C++ was the one below. It's the >>> same message as the C one, differing only by the file name. >>> >>> foo.cpp: In function 'int main()': >>> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >>> TYPE t; >>> ^ >> >> You're the one not paying attention. > > I'm aware of the original error message. However, Jacob used gwowen's > examples as evidence that gcc did produce the type of error messages for > C code that was "impossible" to produce for C++. Clearly he missed the > fact that gwowen also showed C++ code where gcc produced the > "impossible" error message. I assume that jacob thought, as I did, that gowen's example wasn't necessarily relevant. His example involved a declaration of an object with an undeclared type name. The original example involved a call to an undeclared function template. That an useful error message was printed for gowen's example doesn't prove that the useless message printed for the original example had been fixed.
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2015-07-17 14:43 -0400 |
| Message-ID | <55A94CDB.50900@verizon.net> |
| In reply to | #65800 |
On 07/17/2015 02:28 PM, James Kuyper wrote: > On 07/17/2015 02:19 PM, Martin Shobe wrote: >> On 7/17/2015 11:26 AM, James Kuyper wrote: >>> On 07/17/2015 10:24 AM, Martin Shobe wrote: >>>> On 7/17/2015 9:08 AM, jacobnavia wrote: >>>>> Le 17/07/2015 15:50, Martin Shobe a écrit : >>>>>>> >>>>>>> Apparently gcc does it for C, but for C++ it is not possible. >>>>>> >>>>>> The example he gave for gcc "doing it" was for C++. >> >>>>> No. It just gave a "parse error", not a meaningful message like in C. >>>> >>>> Pay attention. The error message for C++ was the one below. It's the >>>> same message as the C one, differing only by the file name. >>>> >>>> foo.cpp: In function 'int main()': >>>> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >>>> TYPE t; >>>> ^ >>> >>> You're the one not paying attention. >> >> I'm aware of the original error message. However, Jacob used gwowen's >> examples as evidence that gcc did produce the type of error messages for >> C code that was "impossible" to produce for C++. Clearly he missed the >> fact that gwowen also showed C++ code where gcc produced the >> "impossible" error message. > > I assume that jacob thought, as I did, that gowen's example wasn't > necessarily relevant. His example involved a declaration of an object > with an undeclared type name. The original example involved a call to an > undeclared function template. That an useful error message was printed > for gowen's example doesn't prove that the useless message printed for > the original example had been fixed. Note, in particular, that the "parse error" was reported as having occurred somewhere before the '>' character in the following line: *buf= std::get_temporary_buffer<type>(size); I know little enough about typical compiler internals, but I would have expected that, immediately after reading the '<' character, the parser would have recognized that get_temporary_buffer was an identifier, and that it would then search it's symbol tables for std::get_temporary_buffer. Upon failing to find it, I'd expect an error message reporting that fact. I don't understand why it waited until after having read the '>' character to report an error, and in particular, to report one not obviously connected to the fact that std::get_temporary_buffer has not yet been declared. It's fairly obvious what it actually did: it's trying to parse std::get_temporary_buffer<type as a comparison expression, and when it reaches the '>' character, it realizes that 'type' isn't something that can participate in a comparison expression. But that doesn't explain why it didn't first identify std::get_temporary_buffer as something that also couldn't appear in a comparison expression. Parsing "TYPE t;" when TYPE has not been declared is a very different context.
[toc] | [prev] | [next] | [standalone]
| From | Bartc <bc@freeuk.com> |
|---|---|
| Date | 2015-07-17 20:31 +0100 |
| Message-ID | <mobl33$3rj$1@dont-email.me> |
| In reply to | #65801 |
On 17/07/2015 19:43, James Kuyper wrote:
> Note, in particular, that the "parse error" was reported as having
> occurred somewhere before the '>' character in the following line:
>
> *buf= std::get_temporary_buffer<type>(size);
>
> I know little enough about typical compiler internals, but I would have
> expected that, immediately after reading the '<' character, the parser
> would have recognized that get_temporary_buffer was an identifier, and
> that it would then search it's symbol tables for
> std::get_temporary_buffer. Upon failing to find it, I'd expect an error
> message reporting that fact. I don't understand why it waited until
> after having read the '>' character to report an error,
(I've no idea how C++ compilers are organised. But when I do this sort
of thing, most lookups of user-identifiers aren't done until a later
pass. Then a failure to resolve a name is no longer a syntax error.
But names which are expected to be type identifiers (because the 'shape'
of the syntax only fits a declaration with a type at the beginning) must
be resolved during parsing.)
and in
> particular, to report one not obviously connected to the fact that
> std::get_temporary_buffer has not yet been declared.
> It's fairly obvious what it actually did: it's trying to parse
> std::get_temporary_buffer<type as a comparison expression, and when it
> reaches the '>' character, it realizes that 'type' isn't something that
> can participate in a comparison expression. But that doesn't explain why
> it didn't first identify std::get_temporary_buffer as something that
> also couldn't appear in a comparison expression.
>
> Parsing "TYPE t;" when TYPE has not been declared is a very different
> context.
With this input, when A has not been declared:
A B;
gcc says that the type 'A' is unknown. But change that to:
A(B);
now that works (if B is in scope), because it now assumes that A(B) is a
function call rather than a variable declaration, even though A(B) could
also be declaring B to be of type A. Perhaps the same thing is going on
in your example.
And C++ is considerably more complicated, as a particular bit of starter
syntax could have more possibilities than in C.
--
Bartc
[toc] | [prev] | [next] | [standalone]
| From | Martin Shobe <martin.shobe@yahoo.com> |
|---|---|
| Date | 2015-07-18 08:41 -0500 |
| Message-ID | <modkvg$oou$1@dont-email.me> |
| In reply to | #65800 |
On 7/17/2015 1:28 PM, James Kuyper wrote: > On 07/17/2015 02:19 PM, Martin Shobe wrote: >> On 7/17/2015 11:26 AM, James Kuyper wrote: >>> On 07/17/2015 10:24 AM, Martin Shobe wrote: >>>> On 7/17/2015 9:08 AM, jacobnavia wrote: >>>>> Le 17/07/2015 15:50, Martin Shobe a écrit : >>>>>>> >>>>>>> Apparently gcc does it for C, but for C++ it is not possible. >>>>>> >>>>>> The example he gave for gcc "doing it" was for C++. >> >>>>> No. It just gave a "parse error", not a meaningful message like in C. >>>> >>>> Pay attention. The error message for C++ was the one below. It's the >>>> same message as the C one, differing only by the file name. >>>> >>>> foo.cpp: In function 'int main()': >>>> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >>>> TYPE t; >>>> ^ >>> >>> You're the one not paying attention. >> >> I'm aware of the original error message. However, Jacob used gwowen's >> examples as evidence that gcc did produce the type of error messages for >> C code that was "impossible" to produce for C++. Clearly he missed the >> fact that gwowen also showed C++ code where gcc produced the >> "impossible" error message. > > I assume that jacob thought, as I did, that gowen's example wasn't > necessarily relevant. His example involved a declaration of an object > with an undeclared type name. The original example involved a call to an > undeclared function template. That an useful error message was printed > for gowen's example doesn't prove that the useless message printed for > the original example had been fixed. > The problem with that assumption is Jacob's response. It was, "Then why not do it for C++" and "Apparently gcc does it for C, but for C++ it is not possible". The only evidence supplied so far gcc doing it for C is gwowen's examples and those work in exactly the same way they do for C++. BTW, the error I get if I try to reproduce the situation is error: 'get_temporary_buffer' is not a member of 'std' Martin Shobe
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2015-07-21 12:25 +0200 |
| Message-ID | <mol6ja$36p$1@dont-email.me> |
| In reply to | #65790 |
On 17/07/15 18:26, James Kuyper wrote: > On 07/17/2015 10:24 AM, Martin Shobe wrote: >> On 7/17/2015 9:08 AM, jacobnavia wrote: >>> Le 17/07/2015 15:50, Martin Shobe a écrit : >>>>> >>>>> Apparently gcc does it for C, but for C++ it is not possible. >>>> >>>> The example he gave for gcc "doing it" was for C++. >>>> >>>> Martin Shobe >>>> >>> >>> No. It just gave a "parse error", not a meaningful message like in C. >> >> Pay attention. The error message for C++ was the one below. It's the >> same message as the C one, differing only by the file name. >> >> foo.cpp: In function 'int main()': >> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >> TYPE t; >> ^ > > You're the one not paying attention. The error message jacob is > rightfully complaining about was generated by g++ 3.2.3 for the > following code: > > *buf= std::get_temporary_buffer<type>(size); > > The error message itself was: > > /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error > before `>' token > > and, as we now know, was caused by the absence of > > #include <message> > > So, at least in that version of g++, the improved error message you > described above had not yet been implemented. > So his complaint was that gcc had poorer error messages 12 years ago? I can't see where he gave the version number of g++ 3.2.3, but I assume you've read something that I missed.
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2015-07-21 13:20 -0400 |
| Message-ID | <moluti$3tg$1@dont-email.me> |
| In reply to | #66092 |
On 07/21/2015 06:25 AM, David Brown wrote: > On 17/07/15 18:26, James Kuyper wrote: >> On 07/17/2015 10:24 AM, Martin Shobe wrote: >>> On 7/17/2015 9:08 AM, jacobnavia wrote: ... >>>> No. It just gave a "parse error", not a meaningful message like in C. >>> >>> Pay attention. The error message for C++ was the one below. It's the >>> same message as the C one, differing only by the file name. >>> >>> foo.cpp: In function 'int main()': >>> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >>> TYPE t; >>> ^ >> >> You're the one not paying attention. The error message jacob is >> rightfully complaining about was generated by g++ 3.2.3 for the >> following code: >> >> *buf= std::get_temporary_buffer<type>(size); >> >> The error message itself was: >> >> /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error >> before `>' token >> >> and, as we now know, was caused by the absence of >> >> #include <message> >> >> So, at least in that version of g++, the improved error message you >> described above had not yet been implemented. >> > > So his complaint was that gcc had poorer error messages 12 years ago? Yes, and I fully agree it's ridiculous to complain about that old a version of a compiler, particularly when the latest version is free and easily available. However, I have not yet seen clear evidence that the current version wouldn't produce a similarly useless message. The example with "TYPE t;" above is very different in many ways from the one involving get_temporary_buffer, ways that might affect whether or not a useful message would be generated. It would be easy to generate proof, one way or the other, if a complete compilable program had been provided. However a lot of the relevant code is insider user-written header files which we've not been given. > I can't see where he gave the version number of g++ 3.2.3, but I assume > you've read something that I missed. The original error message was in the thread with the Subject: SQL filesortcc question: On 07/15/2015 04:40 PM, The Doctor wrote: > All right to essentials on this one. > > Using g++ 3.2.3 , Gmake 4.01 and Cmake 2.6.4 > > I get ... > /usr/source/mysql-5.6.25/sql/filesort_utils.cc: In function `size_t > <unnamed>::try_reserve(std::pair<type*, ptrdiff_t>*, int)': > /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error > before `>' token -- James Kuyper
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2015-07-22 00:05 +0200 |
| Message-ID | <momfjp$3b9$2@dont-email.me> |
| In reply to | #66114 |
On 21/07/15 19:20, James Kuyper wrote: > On 07/21/2015 06:25 AM, David Brown wrote: >> On 17/07/15 18:26, James Kuyper wrote: >>> On 07/17/2015 10:24 AM, Martin Shobe wrote: >>>> On 7/17/2015 9:08 AM, jacobnavia wrote: > ... >>>>> No. It just gave a "parse error", not a meaningful message like in C. >>>> >>>> Pay attention. The error message for C++ was the one below. It's the >>>> same message as the C one, differing only by the file name. >>>> >>>> foo.cpp: In function 'int main()': >>>> foo.cpp:3:3: error: 'TYPE' was not declared in this scope >>>> TYPE t; >>>> ^ >>> >>> You're the one not paying attention. The error message jacob is >>> rightfully complaining about was generated by g++ 3.2.3 for the >>> following code: >>> >>> *buf= std::get_temporary_buffer<type>(size); >>> >>> The error message itself was: >>> >>> /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error >>> before `>' token >>> >>> and, as we now know, was caused by the absence of >>> >>> #include <message> >>> >>> So, at least in that version of g++, the improved error message you >>> described above had not yet been implemented. >>> >> >> So his complaint was that gcc had poorer error messages 12 years ago? > > Yes, and I fully agree it's ridiculous to complain about that old a > version of a compiler, particularly when the latest version is free and > easily available. However, I have not yet seen clear evidence that the > current version wouldn't produce a similarly useless message. The > example with "TYPE t;" above is very different in many ways from the one > involving get_temporary_buffer, ways that might affect whether or not a > useful message would be generated. > > It would be easy to generate proof, one way or the other, if a complete > compilable program had been provided. However a lot of the relevant code > is insider user-written header files which we've not been given. > The complete source code is available, if this is a normal mysql build. But it may have been modified, or there may be something else going on. Certainly a minimal test case is much more useful than a massive source package, even if it is free. >> I can't see where he gave the version number of g++ 3.2.3, but I assume >> you've read something that I missed. > > The original error message was in the thread with the Subject: SQL > filesortcc question: Yes, I spotted that later. I have been away for a couple of weeks, so I'm catching up - and by chance I read this thread before the previous one. > > On 07/15/2015 04:40 PM, The Doctor wrote: >> All right to essentials on this one. >> >> Using g++ 3.2.3 , Gmake 4.01 and Cmake 2.6.4 >> >> I get > ... >> /usr/source/mysql-5.6.25/sql/filesort_utils.cc: In function `size_t >> <unnamed>::try_reserve(std::pair<type*, ptrdiff_t>*, int)': >> /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error >> before `>' token
[toc] | [prev] | [next] | [standalone]
| From | Noob <root@127.0.0.1> |
|---|---|
| Date | 2015-07-17 16:16 +0200 |
| Message-ID | <mob2ke$rl0$1@dont-email.me> |
| In reply to | #65776 |
On 17/07/2015 14:38, jacobnavia wrote: > This whole discussion started with "Doctor" telling us that gcc wrote: > > /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error before >' token > > See thread "SQL filesortcc question" As has been pointed out by Ian, he said he used gcc 3.2.3 That version was released in April 2003. Perhaps he's using 4.2.3, but that's still ancient by software standards.
[toc] | [prev] | [next] | [standalone]
| From | doctor@doctor.nl2k.ab.ca (The Doctor) |
|---|---|
| Date | 2015-07-17 14:49 +0000 |
| Message-ID | <mob4mk$2gd$1@ns2.nl2k.ab.ca> |
| In reply to | #65781 |
In article <mob2ke$rl0$1@dont-email.me>, Noob <root@127.0.0.1> wrote: >On 17/07/2015 14:38, jacobnavia wrote: > >> This whole discussion started with "Doctor" telling us that gcc wrote: >> >> /usr/source/mysql-5.6.25/sql/filesort_utils.cc:178: parse error before >' token >> >> See thread "SQL filesortcc question" > >As has been pointed out by Ian, he said he used gcc 3.2.3 > >That version was released in April 2003. > >Perhaps he's using 4.2.3, but that's still ancient by software standards. > FYI I got mysql 5.6.25 to compile. -- Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca God,Queen and country!Never Satan President Republic!Beware AntiChrist rising! http://www.fullyfollow.me/rootnl2k Look at Psalms 14 and 53 on Atheism Abuse a man unjustly, and you will make friends for him. -Edgar Watson Howe
[toc] | [prev] | [next] | [standalone]
| From | Noob <root@127.0.0.1> |
|---|---|
| Date | 2015-07-17 20:02 +0200 |
| Message-ID | <mobfsd$f2g$1@dont-email.me> |
| In reply to | #65784 |
Doc wrote: > Noob wrote: > >> As has been pointed out by Ian, Doc said he used gcc 3.2.3 >> >> That version was released in April 2003. > > FYI I got mysql 5.6.25 to compile. Maybe you could try with egcs 1.1.2 which had lousy C++ support, that should be even more pointless an exercise...
[toc] | [prev] | [next] | [standalone]
| From | The Doctor <doctor@doctor.nl2k.ab.ca> |
|---|---|
| Date | 2015-07-17 22:24 +0000 |
| Message-ID | <mobvai$mg$2@ns2.nl2k.ab.ca> |
| In reply to | #65795 |
Noob <root@127.0.0.1> wrote: : Doc wrote: : > Noob wrote: : > : >> As has been pointed out by Ian, Doc said he used gcc 3.2.3 : >> : >> That version was released in April 2003. : > : > FYI I got mysql 5.6.25 to compile. : Maybe you could try with egcs 1.1.2 which had lousy C++ support, : that should be even more pointless an exercise... egcs, no wonder it was abandonned long ago. -- Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca God,Queen and country!Never Satan President Republic!Beware AntiChrist rising! http://www.fullyfollow.me/rootnl2k Look at Psalms 14 and 53 on Atheism Abuse a man unjustly, and you will make friends for him. -Edgar Watson Howe
[toc] | [prev] | [next] | [standalone]
| From | Noob <root@127.0.0.1> |
|---|---|
| Date | 2015-07-20 10:46 +0200 |
| Message-ID | <moicf5$gl7$1@dont-email.me> |
| In reply to | #65817 |
On 18/07/2015 00:24, "The Doctor" wrote: > egcs, no wonder it was abandoned long ago. AFAICT, egcs lives on... What is called gcc (as in "GNU Compiler Collection") is, in fact, the descendant of egcs -- which was itself a branch of gcc (as in the original "GNU C Compiler"). https://gcc.gnu.org/wiki/History https://en.wikipedia.org/wiki/GNU_Compiler_Collection#History > EGCS development proved considerably more vigorous than GCC > development, so much so that the FSF officially halted development on > their GCC 2.x compiler, blessed EGCS as the official version of GCC > and appointed the EGCS project as the GCC maintainers in April 1999. > With the release of GCC 2.95 in July 1999 the two projects were once > again united. Regards.
[toc] | [prev] | [next] | [standalone]
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
Back to top | Article view | comp.lang.c
csiph-web