using the "loc" parameter of error() or warning() crashes gcc 4.5

RESOLVED FIXED

Status

RESOLVED FIXED
9 years ago
11 months ago

People

(Reporter: Swatinem, Assigned: Swatinem)

Tracking

Trunk
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

9 years ago
This happens for example in the test_diag_loc.js testcase

  error("test_error", decl.loc);

This line leads to the following GCC error:

*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event			Plugins
PLUGIN_FINISH_TYPE	gcc_dehydra 
PLUGIN_FINISH_UNIT	gcc_dehydra 
PLUGIN_CXX_CP_PRE_GENERICIZE	gcc_dehydra 
PLUGIN_FINISH	gcc_dehydra 
PLUGIN_START_UNIT	gcc_dehydra 
In function 'foo(int, float, char*)':
in pp_base_format, at pretty-print.c:546
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The testcase runs fine when you leave out the loc parameter like this:
  error("test_error");
same applies to warning() too.
(Assignee)

Comment 1

9 years ago
Created attachment 410979 [details] [diff] [review]
patch

Looks like gcc 4.5 needs error_at rather than error with a format parameter.
Assignee: nobody → arpad.borsos
Status: NEW → ASSIGNED
Attachment #410979 - Flags: review?(tglek)
(Assignee)

Comment 2

9 years ago
While working on this bug, I also noticed that the documentation of the builtin functions is wrong.

https://developer.mozilla.org/En/Dehydra/Function_Reference#warning%28.5bcode.2c.5d_msg_.5b.2c_loc.5d%29

It says warning can take a warning code as first argument which it does not according to the actual code.

Comment 3

9 years ago
Created attachment 411231 [details] [diff] [review]
works with 4.3

How is this uglier approach to keep compat with 4.3? I don't really care about 4.2 compat as we basically broke it until someone sits down and works out all of the 4.2 kinks again, there is no point in worrying about it.
Attachment #410979 - Attachment is obsolete: true
Attachment #411231 - Flags: review?(arpad.borsos)
Attachment #410979 - Flags: review?(tglek)

Comment 4

9 years ago
Created attachment 411232 [details] [diff] [review]
actual patch
Attachment #411231 - Attachment is obsolete: true
Attachment #411232 - Flags: review?(arpad.borsos)
Attachment #411231 - Flags: review?(arpad.borsos)
(Assignee)

Updated

9 years ago
Attachment #411232 - Flags: review?(arpad.borsos) → review+

Comment 5

9 years ago
pushed http://hg.mozilla.org/rewriting-and-analysis/dehydra/rev/f4a6c776aada

The commit log is getting Arpad heavy :)

Updated

9 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

11 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.