This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/58151] New: "conflict of writable function parameter in construct with arbitrary order of evaluation" is often a spurious error


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58151

            Bug ID: 58151
           Summary: "conflict of writable function parameter in construct
                    with arbitrary order of evaluation" is often a
                    spurious error
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: prosfilaes at gmail dot com

Created attachment 30651
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30651&action=edit
Code that shows the error message unless you comment out calculations.adb:21

Compiling the attached code with "gnatmake -gnat2012 solver.adb" gives me

gcc -c -gnat2012 solver.adb
gcc -c -gnat2012 calculations.adb
calculations.adb:21:25: "Is_Route" is undefined
calculations.adb:80:58: conflict of writable function parameter in construct
with arbitrary order of evaluation
calculations.adb:81:58: conflict of writable function parameter in construct
with arbitrary order of evaluation
gnatmake: "calculations.adb" compilation error

"Is_Route" is undefined is quite correct. So comment out that pragma Assert on
line 21. Then gnatmake -gnat2012 solver.adb gives me

gcc -c -gnat2012 calculations.adb
calculations.adb:60:07: warning: variable "Length" is never read and never
assigned
calculations.adb:62:07: warning: variable "Optimal" is never read and never
assigned
gcc -c -gnat2012 problem.adb
gnatbind -x solver.ali
gnatlink solver.ali

Suddenly those lines of code on lines 80 and 81 are not a problem.

This is not something special to this chunk of code; I've been getting this
repeatedly when working in Ada2012 mode, where "conflict of writable function
parameter in construct with arbitrary order of evaluation" goes away after a
fix of a completely different error in a completely different part of the file.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]