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

warning: passing argument 1 of ‘validate_protocol’ discards ‘const’ qualifier from pointer target type #330

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

ioquatix
Copy link

@ioquatix ioquatix commented May 1, 2023

../../../../ext/markly/autolink.c: In function ‘postprocess_text’:
../../../../ext/markly/autolink.c:364:31: warning: passing argument 1 of ‘validate_protocol’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  364 |         if (validate_protocol("mailto:", data + start + offset + max_rewind, rewind, max_rewind)) {
      |                               ^~~~~~~~~
../../../../ext/markly/commonmark.c: In function ‘S_render_node’:
../../../../ext/markly/autolink.c:299:36: note: expected ‘char *’ but argument is of type ‘const char *’
  299 | static bool validate_protocol(char protocol[], uint8_t *data, size_t rewind, size_t max_rewind) {
      |                               ~~~~~^~~~~~~~~~

```
../../../../ext/markly/autolink.c: In function ‘postprocess_text’:
../../../../ext/markly/autolink.c:364:31: warning: passing argument 1 of ‘validate_protocol’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  364 |         if (validate_protocol("mailto:", data + start + offset + max_rewind, rewind, max_rewind)) {
      |                               ^~~~~~~~~
../../../../ext/markly/commonmark.c: In function ‘S_render_node’:
../../../../ext/markly/autolink.c:299:36: note: expected ‘char *’ but argument is of type ‘const char *’
  299 | static bool validate_protocol(char protocol[], uint8_t *data, size_t rewind, size_t max_rewind) {
      |                               ~~~~~^~~~~~~~~~
```
@ioquatix
Copy link
Author

ioquatix commented May 1, 2023

Should we upstream this change?

@kevinbackhouse kevinbackhouse merged commit 2d65cd3 into github:master Jun 6, 2023
@ioquatix ioquatix deleted the patch-1 branch June 6, 2023 11:37
@ioquatix
Copy link
Author

ioquatix commented Jun 6, 2023

Thanks! It seems like this doesn't exist upstream? Is it a GFM specific implementation detail?

@kevinbackhouse
Copy link
Collaborator

Thanks! It seems like this doesn't exist upstream? Is it a GFM specific implementation detail?

Yes the "extensions" sub-directory is GFM-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants