Closed Bug 1568869 Opened 4 months ago Closed 4 months ago

Preferences can be defined multiple times in StatcPrefList.yaml if they have different types

Categories

(Core :: Preferences: Backend, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: tjr, Assigned: njn)

Details

Attachments

(1 file)

I hadn't noticed that these were already in the .yaml file:
https://searchfox.org/mozilla-central/rev/40e889be8ff926e32f7567957f4c316f14f6fbef/modules/libpref/init/StaticPrefList.yaml#5742-5751

I had added them myself, without any error. Then when I changed my added ones' type to match the original; and I (finally) got build errors about a duplicate.

(It's possible the mirror type also needs to be the different.)

Example: this build uses this file

Good catch, thank you for the report. The mirror value is key here.

  • The generated C++ code will fail to compile in these pairings: always/always, always/once, once/once.
  • The C++ code will compile ok in these pairings: always/never, once/never, never/never.

I'm not sure what the runtime behaviour will be in those cases, and I don't want to work it out :) I will change generate_static_pref_list.yaml to detect duplicates.

Some double definitions would have caused C++ compile errors, but some would
not, and I'm not even sure what the runtime behaviour would have been in those
latter cases...

Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e2e11c1cb2e2
Disallow double definitions in StaticPrefList.yaml. r=glandium
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.