urnathan / libcody

Compiler/BuildSystem Interface Library
Apache License 2.0
24 stars 6 forks source link

Add space to error message. #27

Closed egorpugin closed 2 years ago

egorpugin commented 2 years ago

Hi,

Currently the error is sticked to previous phrase. Like

main.cpp:1:1: fatal error: unknown Compiled Module Interface: communication error:Unknown error -1
will be
main.cpp:1:1: fatal error: unknown Compiled Module Interface: communication error: Unknown error -1

Should I also send patch to gcc or libcody is eventually updated from here?


Also I've naively fixed an ICE in module.cc (void module_state::set_filename (const Cody::Packet &packet)):

-      error_at (loc, "unknown Compiled Module Interface: %s",
        packet.GetString ().c_str ());
+      fatal_error (loc, "unknown Compiled Module Interface: %s",
        packet.GetString ().c_str ());

If we do not fail here, tons of ICEs come later. There can be communication error, so we do not get same number of packets sent about querying modules. The following function

static void
name_pending_imports (cpp_reader *reader)

iterates over responses and does not check for r_iter == response.end()

          module->set_filename (*r_iter);
          ++r_iter;
urnathan commented 2 years ago

thanks, but you should report these issues to gcc

egorpugin commented 2 years ago

Ok, sure.

This PR with whitespace too? It won't be overwritten in the future from this repo?

boris-kolpackov commented 2 years ago

I think the whitespace change in client.cc should be applied in this repository and then updated in GCC. The rest I agree are GCC-only changes.