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

Safe version of ascii macros, add missing tolower_ascii #25836

Merged
merged 2 commits into from
Mar 22, 2019

Conversation

vnlitvinov
Copy link
Contributor

@vnlitvinov vnlitvinov commented Mar 22, 2019

Using unparenthesized macro parameters is dangerous, so wrap c in braces.

Example warning fixed by adding tolower_ascii():

In file included from pandas/_libs/lib.c:643:0:
pandas/_libs/src/parse_helper.h: In function ‘lowercase’:
pandas/_libs/src/parse_helper.h:141:26: warning: implicit declaration of function ‘tolower_ascii’; did you mean ‘toupper_ascii’? [-Wimplicit-function-declaration]
     for (; *p; ++p) *p = tolower_ascii(*p);
                          ^~~~~~~~~~~~~
                          toupper_ascii

Unverified

This user has not yet uploaded their public signing key.
@chris-b1 chris-b1 added the Clean label Mar 22, 2019
@chris-b1 chris-b1 added this to the 0.25.0 milestone Mar 22, 2019
@chris-b1
Copy link
Contributor

lgtm - thanks! I did this originally, I always forget the right wrapping to make macros safe(er)
@jreback

Unverified

This user has not yet uploaded their public signing key.
@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #25836 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25836      +/-   ##
==========================================
- Coverage    91.3%    91.3%   -0.01%     
==========================================
  Files         173      173              
  Lines       53004    53004              
==========================================
- Hits        48397    48396       -1     
- Misses       4607     4608       +1
Flag Coverage Δ
#multiple 89.87% <ø> (ø) ⬆️
#single 41.77% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/util/testing.py 89.3% <0%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2bcb9f...0d75c62. Read the comment docs.

@vnlitvinov vnlitvinov changed the title Safe version of ascii macros in portable.h Safe version of ascii macros, add missing tolower_ascii Mar 22, 2019
@jreback jreback merged commit 1f7ef05 into pandas-dev:master Mar 22, 2019
@jreback
Copy link
Contributor

jreback commented Mar 22, 2019

thanks @vnlitvin

@vnlitvinov vnlitvinov deleted the fix-ascii-macro branch March 25, 2019 11:05
anmyachev pushed a commit to anmyachev/pandas that referenced this pull request Apr 18, 2019
…5836)

* Safer version of ascii macros in portable.h

* Add missing tolower_ascii macro needed by lowercase() in parse_helper.h
icanhasmath added a commit to ActiveState/pandas that referenced this pull request Apr 3, 2024
…5836)

* Safer version of ascii macros in portable.h

* Add missing tolower_ascii macro needed by lowercase() in parse_helper.h

pandas-dev@1f7ef05
rickprice added a commit to ActiveState/pandas that referenced this pull request Apr 4, 2024
Safe version of ascii macros, add missing tolower_ascii (pandas-dev#25836)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants