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 free build #10

Merged
merged 6 commits into from
Mar 25, 2013
Merged

Warning free build #10

merged 6 commits into from
Mar 25, 2013

Conversation

remicollet
Copy link
Collaborator

Here is some fixes (most trivial) which allow a warning free build, even with -Wall and recent gcc (tried with 4.7.2).

Please check 82bebd4

@krakjoe
Copy link
Owner

krakjoe commented Mar 25, 2013

in apc_lock, ready should be set before commencing initialization of the mutex. Theoretically, if two contexts were to call lock_init concurrently, they may both end up initializing the same mutex which can lead to unexpected behaviour.

@remicollet
Copy link
Collaborator Author

Ok.
So only the missing "return 0" is missing.
If this case (failure in mutex init) should apc_lock_ready stay to 1 or reset to 0 ?

@krakjoe
Copy link
Owner

krakjoe commented Mar 25, 2013

currently the return value is never checked, it is assumed to succeed, so it could also be changed to void, or as you say, should return 0 ... currently void would probably be best, along with throwing an e_error where we would have returned 0, as if execution gets to there, we cannot continue and there is something wrong with the setup.

@remicollet
Copy link
Collaborator Author

Ok, now we have only the "return 0" added (the goal of this PR is only to fix all build warning)

krakjoe added a commit that referenced this pull request Mar 25, 2013
@krakjoe krakjoe merged commit 647cb2b into krakjoe:simplify Mar 25, 2013
@krakjoe
Copy link
Owner

krakjoe commented Mar 25, 2013

Excellent, thanks

CrystSw added a commit to CrystSw/apcu that referenced this pull request Jan 14, 2024
# This is the 1st commit message:

implement history list

# This is the commit message krakjoe#2:

add assert

# This is the commit message krakjoe#3:

rename variable

# This is the commit message krakjoe#4:

implementation of eviction logic

# This is the commit message krakjoe#5:

add comment

# This is the commit message krakjoe#6:

change define

# This is the commit message krakjoe#7:

added info

# This is the commit message krakjoe#8:

remove apc_cache_wlocked_add_history_oldest

# This is the commit message krakjoe#9:

rename function

# This is the commit message krakjoe#10:

update info

# This is the commit message krakjoe#11:

update comment

# This is the commit message krakjoe#12:

fixed loop (cause an infinite loop)

# This is the commit message krakjoe#13:

add memo

# This is the commit message krakjoe#14:

change cleaning timing

# This is the commit message krakjoe#15:

use macros

# This is the commit message krakjoe#16:

fixed size

# This is the commit message krakjoe#17:

update the history in the update process

# This is the commit message krakjoe#18:

refactor
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