Skip to content

Fix declaration after statement for C90 #53

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

Merged
merged 1 commit into from
Nov 29, 2017

Conversation

tiran
Copy link
Member

@tiran tiran commented Nov 29, 2017

In strict ISO C90 mode and on some platforms (e.g. older MSVC), it is
not allowed to declare new variables after a statement. I also find it
good practice to declare first.

Fixes error: ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]

Signed-off-by: Christian Heimes cheimes@redhat.com

@codecov
Copy link

codecov bot commented Nov 29, 2017

Codecov Report

Merging #53 into master will decrease coverage by 0.01%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   63.25%   63.23%   -0.02%     
==========================================
  Files          46       46              
  Lines        4395     4396       +1     
  Branches      749      749              
==========================================
  Hits         2780     2780              
- Misses       1291     1292       +1     
  Partials      324      324
Impacted Files Coverage Δ
Modules/constants.c 47.05% <ø> (ø) ⬆️
Modules/ldapmodule.c 69.56% <0%> (-3.17%) ⬇️
Modules/LDAPObject.c 67.31% <100%> (ø) ⬆️
Modules/message.c 32.53% <100%> (ø) ⬆️

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 a62695e...18b0596. Read the comment docs.

@encukou
Copy link
Member

encukou commented Nov 29, 2017

This only sets CFLAGS for Travis.
I assume that's because they are gcc-specific, and setting them correctly in setup.py is unreasonably hard. Is that right?

@tiran
Copy link
Member Author

tiran commented Nov 29, 2017

I don't want to get in the business of detecting compiler flags in setup.py. It is possible but lots of extra work. Or do you want to include autoconf?

The flags may work with clang but may not work with old gcc. I just don't want to risk breaking people.

@encukou
Copy link
Member

encukou commented Nov 29, 2017

That's reasonable.

@tiran
Copy link
Member Author

tiran commented Nov 29, 2017

Oh fun, now Travis is failing with more warnings. Please merge #49 first.

In strict ISO C90 mode and on some platforms (e.g. older MSVC), it is
not allowed to declare new variables after a statement. I also find it
good practice to declare first.

Fixes error: ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@encukou encukou merged commit de6da53 into python-ldap:master Nov 29, 2017
@tiran tiran deleted the mixed_decl branch November 29, 2017 14:58
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy