-
Notifications
You must be signed in to change notification settings - Fork 133
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
regex: update relevant files in compat/regex #1641
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Chandra Pratap <[email protected]>
re-apply commit a997bf4: get the regex engine to compile within git re-apply c01499e: have space around && and || operators re-apply 19716b2: fix possible overflow errors in binary search re-apply commit 0bdaacf: define intptr_t and uintptr_t on NonStop re-apply commit f65d07f: use compat regex with SANITIZE=address Signed-off-by: Chandra Pratap <[email protected]>
Signed-off-by: Chandra Pratap <[email protected]>
|
||
if (BE (length1 < 0 || length2 < 0 || stop < 0, 0)) | ||
if (__glibc_unlikely ((length1 < 0 || length2 < 0 || stop < 0 | ||
|| ckd_add (&len, length1, length2)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ckd_add()
(or anything else from stdckdint.h
) is C23, that isn't going to be accepted any time soon.
re_compile_fastmap (bufp); | ||
|
||
if (BE (bufp->no_sub, 0)) | ||
if (__glibc_unlikely (bufp->no_sub)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__glibc_unlikely()
and __glibc_likely()
are probably very simple maceo wrappers around __builtin_expect()
, but it might make sense to stick with BE()
instead.
@@ -51,30 +62,15 @@ | |||
# include "../locale/localeinfo.h" | |||
#endif | |||
|
|||
#if defined (_MSC_VER) | |||
#include <stdio.h> /* for size_t */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be the reason for the size_t
errors you mentioned.
re_string_t *pstr, | ||
RE_TRANSLATE_TYPE trans, int icase, | ||
const re_dfa_t *dfa) internal_function; | ||
RE_TRANSLATE_TYPE trans, bool icase, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a test baloon for bool
in Git 2.44.0, but it's better to not introduce bool
in more places right now.
I gave this a whirl two weeks ago, but wasn't able to finish. The current WIP is here: https://github.com/git/git/compare/dscho:compat-regex-update. The strategy I followed was to replace the files with newer versions, and then reapplying Git's patches individually, to ease future upgrades. To that end, I ran
A couple of thoughts:
|
FWIW I got it to compile, but there's quite a lot to clean up and/or change, still. For example, defining |
No description provided.