Here is an interesting thing -
BOOL SetToolbarImage(HWND hwnd,int button, int image)
{ BOOL RetVal = FALSE;
//BookMark [{Bug?}]
RetVal = ToolBar_ChangeBitmap(hwnd,button,image)
ToolBar_AutoSize(hwnd);
return RetVal;
}/* end settoolbarimage */
This compiles without error in Pelles C . . . notice the absence of the semicolon
------
Granted this define adds a semicolon - but is that still within the C guidelines?
#define ToolBar_ChangeBitmap(hwnd,idButton,iBitmap) (BOOL)SNDMSG((hwnd),TB_CHANGEBITMAP,(WPARAM)(idButton),(LPARAM)(iBitmap));
John Z
Even Clang don't give any warnings, so bug report was groundless void ?
Quote from: TimoVJL on January 17, 2025, 06:42:35 AM
Even Clang don't give any warnings, so bug report was groundless ?
Groundless? Well I suppose so if in fact it is not true that every valid C statement must end with a ;
I called it a discrepancy not a bug, since it has no actual impact, other than syntax.
John Z
Many C compilers see code this way:#line 4 "SetToolbarImage.c"
BOOL SetToolbarImage(HWND hwnd,int button, int image)
{ BOOL RetVal = 0;
RetVal = (BOOL)SendMessageA((hwnd),(0x0400 +43),(WPARAM)(button),(LPARAM)(image));
(void)SendMessageA((hwnd),(0x0400 +33),0,0);
return RetVal;
}
If someone use -E or -P, see source after preprocessing.
msvc see it otherwiseSetToolbarImage.c(11): error C2146: syntax error: missing ';' before identifier 'ToolBar_AutoSize'
Thanks,
It is a good day then - I've learned something new.
John Z