Skip to content

Missing return statement(s) in Set_Default_Target? #121

@dvraaij

Description

@dvraaij

While debugging some other problem, I noticed that exceptions are being raised from within Set_Default_Target in libgpr. After reading the code, I was left wondering whether some return statements are missing near line 58 and line 64 in gpr-sdefault.adb.

Near line 64 in particular, without the return statement, the execution of the procedure continues when file default_target is found not to be a regular file (so likely to be non-existing, although there might still be a symbolic link, I guess).

In my case, the file does not exists. This leads to an exception being raised from Ada.Text_IO.Open near line 67, which subsequently crashes the overall program as the traceback generator (invoked as part of the exception information inquiry in the exception handler) raises another exception; the problem I was actually looking into but is outside the scope of this ticket.

Note that my interpretation of the code might be wrong here. I'm not intimately familiar with the intend of the code, but I thought the observation might be of interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions