-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Study the possibility to default to type 'STRING' for variables #266
Labels
Milestone
Comments
Moving this one for 2.7.6, too intrusive to complete #267 |
On a related note:
|
While here, the "IMMUTABLE" flag is also an internal detail that can impact remote users (values that can only be set once). |
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…tools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…ide dstate values [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…workupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…lag on values in DEBUG builds [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…etworkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
… NUMBER to help catch code that did not set the flags [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…c__ and not hard-coded strings [networkupstools#266] This is more streamlined and also fixes some mis-attributed messages (evolution? copy-paste?) Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…unc__ and not hard-coded strings [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…nc__ and not hard-coded strings [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…e as float or long int [networkupstools#266] If we assume a value without flags is by default a NUMBER but is not, re-default it to STRING. If it is also flagged explicitly as a NUMBER but is not, yell a warning for upstream to fix the code. Eventually this should be a reason to report protocol error, but not now. Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…, STRING and NUMBER flags [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…tools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…ide dstate values [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…workupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…lag on values in DEBUG builds [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…etworkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
… NUMBER to help catch code that did not set the flags [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 22, 2024
…c__ and not hard-coded strings [networkupstools#266] This is more streamlined and also fixes some mis-attributed messages (evolution? copy-paste?) Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…rkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…upstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…lag on values in DEBUG builds [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…etworkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…e as float or long int [networkupstools#266] If we assume a value without flags is by default a NUMBER but is not, re-default it to STRING. If it is also flagged explicitly as a NUMBER but is not, yell a warning for upstream to fix the code. Eventually this should be a reason to report protocol error, but not now. Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…, STRING and NUMBER flags [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…E" flag value [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
… reinventing the wheel [networkupstools#266, networkupstools#966] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…pstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…MMUTABLE flag propagation on socket protocol (and fix float=>double) Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…tworkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…orkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…rkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…lag on values in DEBUG builds [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…etworkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…e as float or long int [networkupstools#266] If we assume a value without flags is by default a NUMBER but is not, re-default it to STRING. If it is also flagged explicitly as a NUMBER but is not, yell a warning for upstream to fix the code. Eventually this should be a reason to report protocol error, but not now. Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…, STRING and NUMBER flags [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…E" flag value [networkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
… reinventing the wheel [networkupstools#266, networkupstools#966] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…pstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…MMUTABLE flag propagation on socket protocol (and fix float=>double) Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…tworkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…orkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 23, 2024
…rkupstools#266] Signed-off-by: Jim Klimov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quoting @zykh from #265:
"I know that most of our vars are numbers and so it's easier to only edit the type for the few string ones, but maybe it would be better to have 'STRING' as the default type, since a number can always be stored in a string (well.. not always true, but pretend it to be), but not viceversa: if, for some reason, we lie (like me forgetting to set a var as the correct base type STRING/NUMERIC), then if the default type is STRING and the var is not, we're not doing something as bad as if the default type were NUMERIC and the var a string."
From @aquette:
"defaulting to string would be interesting, but would require to define explicitly a ST_FLAG_NUMBER and to apply it everywhere (where there is no ST_FLAG_STRING) to be useful."
The text was updated successfully, but these errors were encountered: