Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ INSTALL=install
CFLAGS ?= -O2
PICFLAG = -fPIC
C99FLAG = -std=c99
UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) -DUTF8PROC_EXPORTS
WCFLAGS = -Wall -Wmissing-prototypes -pedantic
Copy link
Contributor

@tkelman tkelman Jul 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is -Wmissing-prototypes not included in -Wall? If it isn't, why not? MSVC understands -Wall but not -Wmissing-prototypes, and currently my hacky method of building Julia with MSVC goes through makefiles rather than cmake for some deps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not included in -Wall for gcc.

Copy link
Member

@stevengj stevengj Jul 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it causes problems with MSVC, I would just omit this warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better suggestion: move -Wmissing-prototypes to CFLAGS in .travis.yml.

The flag serves a purpose, to warn when internal functions are accidentally exported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that plan, as long as people will skim the travis logs once in a while

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See .travis.yml, the flag -Werror ensures that Travis will fail on warnings.

The 2.0 release and subsequent #77 proved that warnings will be ignored with certainty unless fatal. 😉

UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) $(WCFLAGS) -DUTF8PROC_EXPORTS

# shared-library version MAJOR.MINOR.PATCH ... this may be *different*
# from the utf8proc version number because it indicates ABI compatibility,
Expand Down
3 changes: 1 addition & 2 deletions test/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ size_t skipspaces(const char *buf, size_t i)
separated by whitespace, and terminated by any character not in
[0-9a-fA-F] or whitespace, then stores the corresponding utf8 string
in dest, returning the number of bytes read from buf */
utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst);
size_t encode(char *dest, const char *buf)
{
size_t i = 0, j, d = 0;
Expand All @@ -48,7 +47,7 @@ size_t encode(char *dest, const char *buf)
}
check(sscanf(buf + i, "%x", (unsigned int *)&c) == 1, "invalid hex input %s", buf+i);
i = j; /* skip to char after hex input */
d += unsafe_encode_char(c, (utf8proc_uint8_t *) (dest + d));
d += utf8proc_encode_char(c, (utf8proc_uint8_t *) (dest + d));
}
}

2 changes: 1 addition & 1 deletion utf8proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_encode_char(utf8proc_int32_t uc, ut
}

/* internal "unsafe" version that does not check whether uc is in range */
utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst) {
static utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst) {
if (uc < 0x00) {
return 0;
} else if (uc < 0x80) {
Expand Down