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

Switch from gnu99 to c99. #52

Merged
merged 3 commits into from
Sep 7, 2015
Merged

Switch from gnu99 to c99. #52

merged 3 commits into from
Sep 7, 2015

Conversation

przemoc
Copy link
Contributor

@przemoc przemoc commented Aug 3, 2014

There was a bad attempt (bad meant as taking wrong approach) at removing gnu99 (along with -Wall, which definitely shouldn't be removed) in pull #51 and when I saw it almost month ago I just had to do things properly, i.e. perform switch from gnu99 to C99 instead. But because I was doing other things simultaneously back then I forgot to push it in the end. So here it is, finally.

Statement expression is GNU C extension, not present in ISO standard.
Type checking works now via implicit conversion performed for compound
literal (compound literals are available since C99). typeof is only used
on GNUC compilers like gcc or clang.
__typeof adheres to ISO C standard as it is reserved identifier [1],
so it is collision-free and works in non-GNU mode as long as compiler
supports it.

[1] C99: "All identifiers that begin with an underscore and either an
uppercase letter or another underscore are always reserved for any use."
Use _XOPEN_SOURCE=600 to make system headers expose Single UNIX
Specification v3 (SUSv3) definitions, i.e. POSIX.1-2001 base
specification plus the X/Open System Interface (XSI) extension.
POSIX.1-2001 is aligned with C99, so that all of the library
functions standardized in C99 are also standardized in POSIX.1-2001.

Use _BSD_SOURCE together with _DEFAULT_SOURCE to compile without
warnings in glibc <= 2.19 and glibc >= 2.20 (_BSD_SOURCE is deprecated
since glibc 2.20 and it has same effect as defining _DEFAULT_SOURCE
but generates a compile-time warning if used alone). This is required
for availability of non-POSIX functions, like inet_aton() or timercmp(),
that are present on most BSD derivatives.

Note: _DEFAULT_SOURCE, which was introduced in glibc 2.19, will actually
bump _POSIX_C_SOURCE from 200112L to 200809L, but it brings no harm.
@antenore
Copy link

antenore commented Aug 4, 2014

@przemoc thanks for these changes. I've integrated it in my fork.

@przemoc
Copy link
Contributor Author

przemoc commented Sep 7, 2015

I'm removing my fork, as this is the only pull request not merged by @darkk. PR will remain valid, though.
https://help.github.com/articles/checking-out-pull-requests-locally/

darkk added a commit that referenced this pull request Sep 7, 2015
@darkk darkk merged commit 2118c61 into darkk:master Sep 7, 2015
@darkk
Copy link
Owner

darkk commented Sep 7, 2015

@przemoc excuse me for missing this PR. It seems to be ok to me.

@darkk
Copy link
Owner

darkk commented Sep 7, 2015

I hope you were not forced to drop your repo like goagent and shadowsocks-windows

@przemoc
Copy link
Contributor Author

przemoc commented Sep 7, 2015

No, no. I'm just doing some late summer cleanings as I haven't been active redsocks user for some time. IMHO forks that are no longer source for fresh stuff (and all their feature branches were already converted into pull requests upstream) should be deleted, to not clutter the forkspace.

Thanks to your message on ML I'm now aware of redsocks2 at semigodking/redsocks. I may look closer at in one day. Short glimpse revealed, though, that many changes weren't introduced as cleanly as I would like them to be, i.e. with proper description and commit granularity, so they're not that nice to follow and it may be easier to just look at the current master than discover all the fixes and improvements through commit log with patches.

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.

3 participants