Skip to content
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

Revert change to %t default precision #22796

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/src/qio/qio_formatted.c
Original file line number Diff line number Diff line change
Expand Up @@ -5013,7 +5013,7 @@ qioerr qio_conv_parse(c_string fmt,
} else if( specifier == 't' ) {
style_out->base = 10;
style_out->pad_char = ' ';
style_out->realfmt = 0;
style_out->realfmt = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: should the same change be applied to %? -- in other words, was it decided that it should use a different precision from %t or was that accidental as well?

Copy link
Contributor Author

@jeremiah-corrado jeremiah-corrado Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was that %t setting style_out->realfmt=2 was a bug in the sense that it was a deviation from the default format. But now that it's deprecated, we should leave the bug in and use the %t -> %? transition as an avenue to move to the correct behavior.

In other words, with %?, I think we really want all of the following to be equivalent (as should have been the case for %t AFAIK):

writef("%?", myArrayOfReals);
write(myArrayOfReals);
stdout.withSerializer(DefaultSerializer).writef("%?", myArrayOfReals);
stdout.withSerializer(DefaultSerializer).write(myArrayOfReals);

Does this agree with your understanding? (I'm also game to have a discussion about this with the IO subteam if you think there might be any doubt about what we should do here).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. No real opinion from me on this point; I was just checking it was intentional, and it was.

style_out->string_format = QIO_STRING_FORMAT_CHPL;

// Handle precision
Expand Down
11 changes: 11 additions & 0 deletions test/compflags/TestWarnUnstableSuppression.3.good
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ $CHPL_HOME/modules/standard/Time.chpl:nnnn: In function 'tm_zoneType':
$CHPL_HOME/modules/standard/Time.chpl:nnnn: warning: 'ChplConfig.CHPL_TARGET_PLATFORM' is unstable and may be replaced with a different way to access this information in the future
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: In function 'getDefaultSparseDist':
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: warning: the type 'dmap' is unstable, instead please use distribution factory functions when available
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_enter':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_leave':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method 'extend':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_warnForParSafeIndexing':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In initializer:
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/IO.chpl:nnnn: In function '_modestring':
$CHPL_HOME/modules/standard/IO.chpl:nnnn: warning: append mode is unstable
$CHPL_HOME/modules/standard/Errors.chpl:nnnn: In method 'deinit':
Expand Down
11 changes: 11 additions & 0 deletions test/compflags/TestWarnUnstableSuppression.5.good
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ $CHPL_HOME/modules/standard/Time.chpl:nnnn: In function 'tm_zoneType':
$CHPL_HOME/modules/standard/Time.chpl:nnnn: warning: 'ChplConfig.CHPL_TARGET_PLATFORM' is unstable and may be replaced with a different way to access this information in the future
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: In function 'getDefaultSparseDist':
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: warning: the type 'dmap' is unstable, instead please use distribution factory functions when available
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_enter':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_leave':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method 'extend':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_warnForParSafeIndexing':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In initializer:
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/IO.chpl:nnnn: In function '_modestring':
$CHPL_HOME/modules/standard/IO.chpl:nnnn: warning: append mode is unstable
$CHPL_HOME/modules/standard/Errors.chpl:nnnn: In method 'deinit':
Expand Down
11 changes: 11 additions & 0 deletions test/compflags/TestWarnUnstableSuppression.6.good
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ $CHPL_HOME/modules/standard/Time.chpl:nnnn: In function 'tm_zoneType':
$CHPL_HOME/modules/standard/Time.chpl:nnnn: warning: 'ChplConfig.CHPL_TARGET_PLATFORM' is unstable and may be replaced with a different way to access this information in the future
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: In function 'getDefaultSparseDist':
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: warning: the type 'dmap' is unstable, instead please use distribution factory functions when available
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_enter':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_leave':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method 'extend':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_warnForParSafeIndexing':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In initializer:
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/IO.chpl:nnnn: In function '_modestring':
$CHPL_HOME/modules/standard/IO.chpl:nnnn: warning: append mode is unstable
$CHPL_HOME/modules/internal/BytesStringCommon.chpl:nnnn: In function 'doSearchNoEnc':
Expand Down
11 changes: 11 additions & 0 deletions test/compflags/TestWarnUnstableSuppression.7.good
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ $CHPL_HOME/modules/standard/Time.chpl:nnnn: In function 'tm_zoneType':
$CHPL_HOME/modules/standard/Time.chpl:nnnn: warning: 'ChplConfig.CHPL_TARGET_PLATFORM' is unstable and may be replaced with a different way to access this information in the future
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: In function 'getDefaultSparseDist':
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:nnnn: warning: the type 'dmap' is unstable, instead please use distribution factory functions when available
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_enter':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_leave':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method 'extend':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In method '_warnForParSafeIndexing':
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/Map.chpl:nnnn: In initializer:
$CHPL_HOME/modules/standard/Map.chpl:nnnn: warning: 'map.parSafe' is unstable and is expected to be replaced by a separate map type in the future
$CHPL_HOME/modules/standard/IO.chpl:nnnn: In function '_modestring':
$CHPL_HOME/modules/standard/IO.chpl:nnnn: warning: append mode is unstable
$CHPL_HOME/modules/internal/BytesStringCommon.chpl:nnnn: In function 'doSearchNoEnc':
Expand Down