Skip to content

Bounds on variables may use undefined values  #726

Open
@kyleheadley

Description

@kyleheadley

similar to #524, but outside of function prototypes

3C will infer : count(length) bounds on arrays from related variables, but those variables may not be in the local scope. for example, from icecast:

connection.c:456:44: error: use of undeclared identifier 'dst'
    _Array_ptr<struct pollfd> ufds : count(dst);
                                           ^

and the pre-converted code is:

    struct pollfd ufds [global.server_sockets];
    if(...) {
        ...
    else {
        int dst;
        ...
        global.server_sockets = dst;
        ...
    }

from yacr2:

./channel.h:42:38: error: use of undeclared identifier 'channelColumns'
extern _Array_ptr<ulong> TOP : count(channelColumns);
                                     ^

This file contains global defs and channelColumns is defined soon after TOP (along with other counters). I assume the connection is made from usage in another file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions