-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Removes implementation of my_strdup() from the multi VFD #527
Merged
lrknox
merged 11 commits into
HDFGroup:develop
from
derobins:minor/remove_multi_my_strdup
Mar 31, 2021
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ba9deae
Committing clang-format changes
github-actions[bot] 00f9750
Merge remote-tracking branch 'canonical/develop' into develop
derobins e997283
Merge remote-tracking branch 'canonical/develop' into develop
derobins 3eac585
Merge remote-tracking branch 'canonical/develop' into develop
derobins 71643b7
Merge remote-tracking branch 'canonical/develop' into develop
derobins d242911
Merge remote-tracking branch 'canonical/develop' into develop
derobins bc70f95
Merge remote-tracking branch 'canonical/develop' into develop
derobins 3d7ad8e
Merge remote-tracking branch 'canonical/develop' into develop
derobins aeb16b7
Merge branch 'develop' of https://github.com/derobins/hdf5 into develop
derobins 78ac479
Removes my_strdup() from the multi VFD
derobins e109ab2
Use strdup directly when memory sanity checks are off
derobins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't just define strdup as _strdup as the former also exists on Windows. The problem with just using strdup directly is that it's deprecated and raises warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strdup isn't deprecated, it wasn't part of the C Standard (until the upcoming C23: https://en.cppreference.com/w/c/experimental/dynamic/strdup). We can't rely on it being available on all platforms yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-underscore name is deprecated on Windows. From MSDN:
The Microsoft-implemented POSIX function names strdup and wcsdup are deprecated aliases for the _strdup and _wcsdup functions. By default, they generate Compiler warning (level 3) C4996. The names are deprecated because they don't follow the Standard C rules for implementation-specific names. However, the functions are still supported.
We recommend you use _strdup and _wcsdup instead. Or, you can continue to use these function names, and disable the warning. For more information, see Turn off the warning and POSIX function names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry! I misinterpreted your comment and thought it was about strdup itself. My comment was toward that direction: strdup isn't (yet) part of the C Standard, so this VFD may need the my_strdup() code for a while longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the library doesn't really have an option if you don't have strdup. Either you have POSIX strdup or Windows _strdup or you are out of luck. In the "out of luck" case, we declare a strdup function exists, but we don't provide an implementation. The code in H5private.h says strdup is non-POSIX, but that's probably pre-2001 code.