-
-
Couldn't load subscription status.
- Fork 5.9k
Fix clang/OS X warnings about embedded directives within macro arguments to sprintf #788
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
Conversation
|
On Thursday, May 5, 2016 at 12:57:14 AM UTC-5, Michael Jarvis wrote:
It worked! 😃 |
|
Michael Jarvis wrote:
Thanks. I'll adjust it a bit to avoid duplicating the expressions. ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \ |
- 7.4.1818: Help completion adds @en to all matches except the first one. Remove "break", go over all items. - 7.4.1819: Compiler warnings when sprintf() is a macro. Don't interrupt sprintf() with an #ifdef. (Michael Jarvis, closes vim#788) - 7.4.1820: Removing language from help tags too often. Only remove @en when not needed. (Hirohito Higashi) - 7.4.1821: Test fails on MS-Windows. Sort the completion results. - 7.4.1822: Redirecting stdout of a channel to "null" doesn't work. (Nicola) Correct the file descriptor number. - 7.4.1823: Warning from 64 bit compiler. Add type cast. (Mike Williams) - 7.4.1824: When a job is no longer referenced and does not have an exit callback the process may hang around in defunc state. (Nicola) Call job_status() if the job is running and won't get freed because it might still be useful. - 7.4.1825: When job writes to buffer nothing is written. (Nicola) Do not discard a channel before writing is done. - 7.4.1826: Callbacks are invoked when it's not safe. (Andrew Stewart) When a channel is to be closed don't invoke callbacks right away, wait for a safe moment. - 7.4.1827: No error when invoking a callback when it's not safe. Add an error message. Avoid the error when freeing a channel. - 7.4.1828: May try to access buffer that's already freed. When freeing a buffer remove it from any channel. - 7.4.1829: No message on channel log when buffer was freed. Log a message. - 7.4.1830: non-antialiased misnamed. Use NONANTIALIASED and NONANTIALIASED_QUALITY. (Kim Brouer, closes vim#793)
* origin/master: (25 commits) patch 7.4.1819 Problem: Compiler warnings when sprintf() is a macro. Solution: Don't interrupt sprintf() with an #ifdef. (Michael Jarvis, closes vim#788) patch 7.4.1818 Problem: Help completion adds @en to all matches except the first one. Solution: Remove "break", go over all items. patch 7.4.1817 Problem: The screen is not updated if a callback is invoked when closing a channel. Solution: Invoke redraw_after_callback(). patch 7.4.1816 Problem: Looping over a null list throws an error. Solution: Skip over the for loop. patch 7.4.1815 Problem: Compiler warnings for unused variables. (Ajit Thakkar) Solution: Add a dummy initialization. (Yasuhiro Matsumoto) patch 7.4.1814 Problem: A channel may be garbage collected while it's still being used by a job. (James McCoy) Solution: Mark the channel as used if the job is still used. Do the same for channels that are still used. patch 7.4.1813 Problem: Memory access error when running test_quickfix. Solution: Allocate one more byte. (Yegappan Lakshmanan) patch 7.4.1812 Problem: Failure on startup with Athena and Motif. Solution: Check for INVALCOLOR. (Kazunobu Kuriyama) patch 7.4.1811 Problem: Netbeans channel gets garbage collected. Solution: Set reference in nb_channel. patch 7.4.1810 Problem: Sending DETACH after a channel was closed isn't useful. Solution: Only add DETACH for a netbeans channel. patch 7.4.1809 Problem: Using wrong short option name for 'termguicolors'. Solution: Use the option name. patch 7.4.1808 Problem: Using wrong feature name to check for 'termguicolors'. Solution: Use the right feature name. (Ken Takata) patch 7.4.1807 Problem: Test_out_close_cb sometimes fails. Solution: Always write DETACH to out, not err. patch 7.4.1806 Problem: 'termguicolors' option missing from the options window. Solution: Add the entry. Update runtime files. patch 7.4.1805 Problem: Running tests in shadow dir fails. Solution: Link the samples directory patch 7.4.1804 Problem: Can't use Vim as MANPAGER. Solution: Add manpager.vim. (Enno Nagel, closes vim#491) patch 7.4.1803 Problem: GTK3 doesn't handle menu separaters properly. Solution: Use gtk_separator_menu_item_new(). (Kazunobu Kuriyama) patch 7.4.1802 Problem: Quickfix doesn't handle long lines well, they are split. Solution: Drop characters after a limit. (Anton Lindqvist) patch 7.4.1801 Problem: Make uninstall leaves file behind. Solution: Delete rgb.txt. (Kazunobu Kuriyama) ...
While compiling with clang on OS X, there are some warnings about undefined behavior because of embedded pre-processor directives in preprocessor macros.
Apparently sprintf(3) is implemented as a macro, and there are places where a directive is used to control parameters that are passed to sprintf. I did a quick test with some sample code, and it appears to work okay, but naturally it's not good to rely on undefined behavior.
I think the easiest fix would be to just modify the calls to sprintf() so that the directives wrap the complete macro calls, and not just wrap a parameter.
Also, I've submitted patches to the list before, but this is my first attempt at using a Github pull request instead of just writing a post directly to vim-dev. Hopefully this works! :-)