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

unix: replace use of strcpy in mkerrors.sh #147

Closed
wants to merge 1 commit into from

Conversation

jrick
Copy link
Contributor

@jrick jrick commented Feb 15, 2023

On OpenBSD-current, clang emits a warning message to standard output for the use of strcpy, e.g.:

_errors.c(/tmp/_errors-673190.o:(main)): warning: strcpy() is almost always misused, please use strlcpy()

This message makes it into the Go source being created, causing gofmt to error on the invalid syntax, and leaving the zerrors file empty.

Using strlcpy would be preferred here, but strncpy is enough to silence this message, and is more portable.

@gopherbot
Copy link

This PR (HEAD: 13a853a) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/sys/+/468399 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/468399.
After addressing review feedback, remember to publish your drafts!

On OpenBSD-current, clang emits a warning message to standard output
for the use of strcpy, e.g.:

_errors.c(/tmp/_errors-673190.o:(main)): warning: strcpy() is almost always
misused, please use strlcpy()

This message makes it into the Go source being created, causing gofmt
to error on the invalid syntax, and leaving the zerrors file empty.

Using strlcpy would be preferred here, but strncpy is enough to
silence this message, and is more portable.
@gopherbot
Copy link

This PR (HEAD: a43b6fb) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/sys/+/468399 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

Message from Josh Rickmar:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/468399.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 2: Auto-Submit+1 Code-Review+2 Run-TryBot+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/468399.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/468399.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gopher Robot:

Patch Set 2: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/468399.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Jun 6, 2023
On OpenBSD-current, clang emits a warning message to standard output for the use of strcpy, e.g.:

_errors.c(/tmp/_errors-673190.o:(main)): warning: strcpy() is almost always misused, please use strlcpy()

This message makes it into the Go source being created, causing gofmt to error on the invalid syntax, and leaving the zerrors file empty.

Using strlcpy would be preferred here, but strncpy is enough to silence this message, and is more portable.

Change-Id: I16404d74c4406dadda87f211fc0ba062de0d11ac
GitHub-Last-Rev: a43b6fb
GitHub-Pull-Request: #147
Reviewed-on: https://go-review.googlesource.com/c/sys/+/468399
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
@gopherbot
Copy link

This PR is being closed because golang.org/cl/468399 has been merged.

@gopherbot gopherbot closed this Jun 6, 2023
@jrick jrick deleted the strcpy_warning branch June 6, 2023 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants