Closed Bug 527220 Opened 15 years ago Closed 15 years ago

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

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Swatinem, Assigned: Swatinem)

References

Details

Attachments

(1 file, 2 obsolete files)

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.
Attached patch patch (obsolete) — Splinter Review
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)
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.
Attached patch works with 4.3 (obsolete) — Splinter Review
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)
Attached patch actual patchSplinter Review
Attachment #411231 - Attachment is obsolete: true
Attachment #411232 - Flags: review?(arpad.borsos)
Attachment #411231 - Flags: review?(arpad.borsos)
Attachment #411232 - Flags: review?(arpad.borsos) → review+
pushed http://hg.mozilla.org/rewriting-and-analysis/dehydra/rev/f4a6c776aada

The commit log is getting Arpad heavy :)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: