mirror of
https://github.com/pissnet/pissircd.git
synced 2025-05-17 02:45:04 +01:00
Windows build: Add format string verification during build.
(Will be used to hunt and fix those time_t integer type mismatches)
This commit is contained in:
parent
1f99b282b0
commit
85b3b91b19
7 changed files with 209 additions and 53 deletions
|
@ -127,16 +127,19 @@ MODDBGCFLAG=/LDd /MD /Zi
|
|||
|
||||
FD_SETSIZE=/D FD_SETSIZE=16384
|
||||
CFLAGS=$(DBGCFLAG) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /J /I ./INCLUDE /Fosrc/ /nologo \
|
||||
$(CURLCFLAGS) $(FD_SETSIZE) $(SSLCFLAGS) /D NOSPOOF=1 /c /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
|
||||
$(CURLCFLAGS) $(FD_SETSIZE) $(SSLCFLAGS) /D NOSPOOF=1 /c /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE \
|
||||
/analyze:ruleset extras\VStudioAnalyze.ruleset
|
||||
CFLAGSST=$(DBGCFLAGST) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /J /I ./INCLUDE /Fosrc/ /nologo \
|
||||
$(CURLCFLAGS) $(FD_SETSIZE) $(SSLCFLAGS) /D NOSPOOF=1 /c /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
|
||||
$(CURLCFLAGS) $(FD_SETSIZE) $(SSLCFLAGS) /D NOSPOOF=1 /c /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE \
|
||||
/analyze:ruleset extras\VStudioAnalyze.ruleset
|
||||
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib ws2_32.lib advapi32.lib \
|
||||
dbghelp.lib oldnames.lib comctl32.lib comdlg32.lib $(CARES_LIB) $(CARESLIB) \
|
||||
$(PCRE2_LIB) $(PCRE2LIB) $(ARGON2_LIB) $(ARGON2LIB) $(LIBRESSL_LIB) $(SSLLIB) $(LIBCURL_LIB) $(CURLLIB) /def:UnrealIRCd.def /implib:UnrealIRCd.lib \
|
||||
$(PCRE2_LIB) $(PCRE2LIB) $(ARGON2_LIB) $(ARGON2LIB) $(LIBRESSL_LIB) $(SSLLIB) $(LIBCURL_LIB) $(CURLLIB) /def:UnrealIRCd.def /implib:UnrealIRCd.lib \
|
||||
/nologo $(DBGLFLAG) /out:UnrealIRCd.exe
|
||||
MODCFLAGS=$(MODDBGCFLAG) $(SSLCFLAGS) $(CURLCFLAGS) /J /Fesrc/modules/ \
|
||||
/Fosrc/modules/ /nologo $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /I ./INCLUDE /D \
|
||||
DYNAMIC_LINKING /D NOSPOOF /D MODULE_COMPILE /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
|
||||
DYNAMIC_LINKING /D NOSPOOF /D MODULE_COMPILE /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE \
|
||||
/analyze:ruleset extras\VStudioAnalyze.ruleset
|
||||
MODLFLAGS=/link /def:src/modules/module.def UnrealIRCd.lib ws2_32.lib \
|
||||
$(PCRE2_LIB) $(PCRE2LIB) $(ARGON2_LIB) $(ARGON2LIB) $(CARES_LIB) $(LIBRESSL_LIB) $(SSLLIB) \
|
||||
$(LIBCURL_LIB) $(CURLLIB)
|
||||
|
|
155
extras/VStudioAnalyze.ruleset
Executable file
155
extras/VStudioAnalyze.ruleset
Executable file
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="UnrealIRCd rules - based off Microsoft Native Minimum Rules" Description="These rules focus on the most critical problems in your native code, including potential security holes and application crashes. It is recommended to include this rule set in any custom rule set you create for your native projects." ToolsVersion="10.0">
|
||||
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
|
||||
<Name Resource="NativeMinimumRules_Name" />
|
||||
<Description Resource="NativeMinimumRules_Description" />
|
||||
</Localization>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
|
||||
<Rule Id="C6001" Action="Warning" />
|
||||
<!-- Many false positives <Rule Id="C6011" Action="Warning" /> -->
|
||||
<Rule Id="C6029" Action="Warning" />
|
||||
<Rule Id="C6053" Action="Warning" />
|
||||
<Rule Id="C6059" Action="Warning" />
|
||||
<Rule Id="C6063" Action="Warning" />
|
||||
<Rule Id="C6064" Action="Warning" />
|
||||
<Rule Id="C6066" Action="Warning" />
|
||||
<Rule Id="C6067" Action="Warning" />
|
||||
<Rule Id="C6101" Action="Warning" />
|
||||
<Rule Id="C6200" Action="Warning" />
|
||||
<Rule Id="C6201" Action="Warning" />
|
||||
<Rule Id="C6270" Action="Warning" />
|
||||
<Rule Id="C6271" Action="Warning" />
|
||||
<Rule Id="C6272" Action="Warning" />
|
||||
<Rule Id="C6273" Action="Warning" />
|
||||
<Rule Id="C6274" Action="Warning" />
|
||||
<Rule Id="C6276" Action="Warning" />
|
||||
<Rule Id="C6277" Action="Warning" />
|
||||
<Rule Id="C6284" Action="Warning" />
|
||||
<Rule Id="C6290" Action="Warning" />
|
||||
<Rule Id="C6291" Action="Warning" />
|
||||
<Rule Id="C6302" Action="Warning" />
|
||||
<Rule Id="C6303" Action="Warning" />
|
||||
<Rule Id="C6305" Action="Warning" />
|
||||
<Rule Id="C6306" Action="Warning" />
|
||||
<Rule Id="C6328" Action="Warning" />
|
||||
<Rule Id="C6385" Action="Warning" />
|
||||
<!-- <Rule Id="C6386" Action="Warning" /> the analysis this one does - or lack thereof - is particularly dumb pffff -->
|
||||
<!-- <Rule Id="C6387" Action="Warning" /> more null/0 false positives -->
|
||||
<Rule Id="C6500" Action="Warning" />
|
||||
<Rule Id="C6501" Action="Warning" />
|
||||
<Rule Id="C6503" Action="Warning" />
|
||||
<Rule Id="C6504" Action="Warning" />
|
||||
<Rule Id="C6505" Action="Warning" />
|
||||
<Rule Id="C6506" Action="Warning" />
|
||||
<Rule Id="C6508" Action="Warning" />
|
||||
<Rule Id="C6509" Action="Warning" />
|
||||
<Rule Id="C6510" Action="Warning" />
|
||||
<Rule Id="C6511" Action="Warning" />
|
||||
<Rule Id="C6513" Action="Warning" />
|
||||
<Rule Id="C6514" Action="Warning" />
|
||||
<Rule Id="C6515" Action="Warning" />
|
||||
<Rule Id="C6516" Action="Warning" />
|
||||
<Rule Id="C6517" Action="Warning" />
|
||||
<Rule Id="C6518" Action="Warning" />
|
||||
<Rule Id="C6522" Action="Warning" />
|
||||
<Rule Id="C6525" Action="Warning" />
|
||||
<Rule Id="C6527" Action="Warning" />
|
||||
<Rule Id="C6530" Action="Warning" />
|
||||
<Rule Id="C6540" Action="Warning" />
|
||||
<Rule Id="C6551" Action="Warning" />
|
||||
<Rule Id="C6552" Action="Warning" />
|
||||
<Rule Id="C6701" Action="Warning" />
|
||||
<Rule Id="C6702" Action="Warning" />
|
||||
<Rule Id="C6703" Action="Warning" />
|
||||
<Rule Id="C6704" Action="Warning" />
|
||||
<Rule Id="C6705" Action="Warning" />
|
||||
<Rule Id="C6706" Action="Warning" />
|
||||
|
||||
<!-- CppCoreCheck -->
|
||||
<!-- Span/View over temporary -->
|
||||
<Rule Id="C26449" Action="Warning" />
|
||||
<!-- Arithmetic overflow -->
|
||||
<Rule Id="C26450" Action="Warning" />
|
||||
<Rule Id="C26451" Action="Warning" />
|
||||
<Rule Id="C26452" Action="Warning" />
|
||||
<Rule Id="C26453" Action="Warning" />
|
||||
<Rule Id="C26454" Action="Warning" />
|
||||
<!-- Unitialized Member -->
|
||||
<Rule Id="C26495" Action="Warning" />
|
||||
|
||||
<Rule Id="C28021" Action="Warning" />
|
||||
<!-- <Rule Id="C28182" Action="Warning" /> false positives for dereferencing null ptr -->
|
||||
<Rule Id="C28202" Action="Warning" />
|
||||
<Rule Id="C28203" Action="Warning" />
|
||||
<Rule Id="C28205" Action="Warning" />
|
||||
<Rule Id="C28206" Action="Warning" />
|
||||
<Rule Id="C28207" Action="Warning" />
|
||||
<Rule Id="C28210" Action="Warning" />
|
||||
<Rule Id="C28211" Action="Warning" />
|
||||
<Rule Id="C28212" Action="Warning" />
|
||||
<Rule Id="C28213" Action="Warning" />
|
||||
<Rule Id="C28214" Action="Warning" />
|
||||
<Rule Id="C28215" Action="Warning" />
|
||||
<Rule Id="C28216" Action="Warning" />
|
||||
<Rule Id="C28217" Action="Warning" />
|
||||
<Rule Id="C28218" Action="Warning" />
|
||||
<Rule Id="C28219" Action="Warning" />
|
||||
<Rule Id="C28220" Action="Warning" />
|
||||
<Rule Id="C28221" Action="Warning" />
|
||||
<Rule Id="C28222" Action="Warning" />
|
||||
<Rule Id="C28223" Action="Warning" />
|
||||
<Rule Id="C28224" Action="Warning" />
|
||||
<Rule Id="C28225" Action="Warning" />
|
||||
<Rule Id="C28226" Action="Warning" />
|
||||
<Rule Id="C28227" Action="Warning" />
|
||||
<Rule Id="C28228" Action="Warning" />
|
||||
<Rule Id="C28229" Action="Warning" />
|
||||
<Rule Id="C28230" Action="Warning" />
|
||||
<Rule Id="C28231" Action="Warning" />
|
||||
<Rule Id="C28232" Action="Warning" />
|
||||
<Rule Id="C28233" Action="Warning" />
|
||||
<Rule Id="C28234" Action="Warning" />
|
||||
<Rule Id="C28235" Action="Warning" />
|
||||
<Rule Id="C28236" Action="Warning" />
|
||||
<Rule Id="C28237" Action="Warning" />
|
||||
<Rule Id="C28238" Action="Warning" />
|
||||
<Rule Id="C28239" Action="Warning" />
|
||||
<Rule Id="C28240" Action="Warning" />
|
||||
<Rule Id="C28241" Action="Warning" />
|
||||
<Rule Id="C28243" Action="Warning" />
|
||||
<Rule Id="C28245" Action="Warning" />
|
||||
<Rule Id="C28246" Action="Warning" />
|
||||
<Rule Id="C28250" Action="Warning" />
|
||||
<!-- <Rule Id="C28251" Action="Warning" /> this may be real but it's damn annoying: inconsistent annotation for function -->
|
||||
<Rule Id="C28252" Action="Warning" />
|
||||
<Rule Id="C28253" Action="Warning" />
|
||||
<Rule Id="C28254" Action="Warning" />
|
||||
<Rule Id="C28262" Action="Warning" />
|
||||
<Rule Id="C28263" Action="Warning" />
|
||||
<Rule Id="C28267" Action="Warning" />
|
||||
<Rule Id="C28272" Action="Warning" />
|
||||
<Rule Id="C28273" Action="Warning" />
|
||||
<Rule Id="C28275" Action="Warning" />
|
||||
<Rule Id="C28279" Action="Warning" />
|
||||
<Rule Id="C28280" Action="Warning" />
|
||||
<Rule Id="C28282" Action="Warning" />
|
||||
<Rule Id="C28285" Action="Warning" />
|
||||
<Rule Id="C28286" Action="Warning" />
|
||||
<Rule Id="C28287" Action="Warning" />
|
||||
<Rule Id="C28288" Action="Warning" />
|
||||
<Rule Id="C28289" Action="Warning" />
|
||||
<Rule Id="C28290" Action="Warning" />
|
||||
<Rule Id="C28291" Action="Warning" />
|
||||
<Rule Id="C28300" Action="Warning" />
|
||||
<Rule Id="C28301" Action="Warning" />
|
||||
<Rule Id="C28302" Action="Warning" />
|
||||
<Rule Id="C28303" Action="Warning" />
|
||||
<Rule Id="C28304" Action="Warning" />
|
||||
<Rule Id="C28305" Action="Warning" />
|
||||
<Rule Id="C28308" Action="Warning" />
|
||||
<Rule Id="C28309" Action="Warning" />
|
||||
<Rule Id="C28350" Action="Warning" />
|
||||
<Rule Id="C28351" Action="Warning" />
|
||||
</Rules>
|
||||
</RuleSet>
|
62
include/h.h
62
include/h.h
|
@ -102,8 +102,8 @@ extern EVENT(e_clean_out_throttling_buckets);
|
|||
extern void module_loadall(void);
|
||||
extern long set_usermode(char *umode);
|
||||
extern char *get_modestr(long umodes);
|
||||
extern void config_error(char *format, ...) __attribute__((format(printf,1,2)));
|
||||
extern void config_warn(char *format, ...) __attribute__((format(printf,1,2)));
|
||||
extern void config_error(FORMAT_STRING(char *format), ...) __attribute__((format(printf,1,2)));
|
||||
extern void config_warn(FORMAT_STRING(char *format), ...) __attribute__((format(printf,1,2)));
|
||||
extern void config_error_missing(const char *filename, int line, const char *entry);
|
||||
extern void config_error_unknown(const char *filename, int line, const char *block, const char *entry);
|
||||
extern void config_error_unknownflag(const char *filename, int line, const char *block, const char *entry);
|
||||
|
@ -114,7 +114,7 @@ extern void config_error_empty(const char *filename, int line, const char *block
|
|||
extern void config_warn_duplicate(const char *filename, int line, const char *entry);
|
||||
extern int config_is_blankorempty(ConfigEntry *cep, const char *block);
|
||||
extern MODVAR int config_verbose;
|
||||
extern void config_progress(char *format, ...) __attribute__((format(printf,1,2)));
|
||||
extern void config_progress(FORMAT_STRING(char *format), ...) __attribute__((format(printf,1,2)));
|
||||
extern void ipport_seperate(char *string, char **ip, char **port);
|
||||
extern ConfigItem_class *Find_class(char *name);
|
||||
extern ConfigItem_deny_dcc *Find_deny_dcc(char *name);
|
||||
|
@ -206,7 +206,7 @@ extern Ban *is_banned(aClient *, aChannel *, int, char **, char **);
|
|||
extern Ban *is_banned_with_nick(aClient *, aChannel *, int, char *, char **, char **);
|
||||
extern int parse_help(aClient *, char *, char *);
|
||||
|
||||
extern void ircd_log(int, char *, ...) __attribute__((format(printf,2,3)));
|
||||
extern void ircd_log(int, FORMAT_STRING(char *), ...) __attribute__((format(printf,2,3)));
|
||||
extern aClient *find_client(char *, aClient *);
|
||||
extern aClient *find_name(char *, aClient *);
|
||||
extern aClient *find_nickserv(char *, aClient *);
|
||||
|
@ -229,13 +229,6 @@ extern MODFUNC char *sock_strerror(int);
|
|||
#endif
|
||||
extern int dgets(int, char *, int);
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
extern int snprintf (char *str, size_t count, const char *fmt, ...);
|
||||
#endif
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
extern int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
extern MODVAR int debuglevel;
|
||||
#else
|
||||
|
@ -287,28 +280,27 @@ extern void sendto_message_one(aClient *to, aClient *from, char *sender,
|
|||
extern void sendto_channel(aChannel *chptr, aClient *from, aClient *skip,
|
||||
int prefix, long clicap, int sendflags,
|
||||
MessageTag *mtags,
|
||||
char *pattern, ...) __attribute__((format(printf,8,9)));
|
||||
FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,8,9)));
|
||||
extern void sendto_local_common_channels(aClient *user, aClient *skip,
|
||||
long clicap, MessageTag *mtags,
|
||||
char *pattern, ...) __attribute__((format(printf,5,6)));
|
||||
extern void sendto_match_servs(aChannel *, aClient *, char *, ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_match_butone(aClient *, aClient *, char *, int, MessageTag *,
|
||||
char *pattern, ...) __attribute__((format(printf,6,7)));
|
||||
extern void sendto_all_butone(aClient *, aClient *, char *, ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_ops(char *, ...) __attribute__((format(printf,1,2)));
|
||||
extern void sendto_ops_butone(aClient *, aClient *, char *, ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_ops_butme(aClient *, char *, ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_prefix_one(aClient *, aClient *, MessageTag *, const char *, ...) __attribute__((format(printf,4,5)));
|
||||
extern void sendto_opers(char *, ...) __attribute__((format(printf,1,2)));
|
||||
extern void sendto_umode(int, char *, ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_umode_global(int, char *, ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_snomask(int snomask, char *pattern, ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_snomask_global(int snomask, char *pattern, ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendnotice(aClient *to, char *pattern, ...) __attribute__((format(printf,2,3)));
|
||||
FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,5,6)));
|
||||
extern void sendto_match_servs(aChannel *, aClient *, FORMAT_STRING(char *), ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_match_butone(aClient *, aClient *, FORMAT_STRING(char *), int, MessageTag *,
|
||||
FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,6,7)));
|
||||
extern void sendto_all_butone(aClient *, aClient *, FORMAT_STRING(char *), ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_ops(FORMAT_STRING(char *), ...) __attribute__((format(printf,1,2)));
|
||||
extern void sendto_ops_butone(FORMAT_STRING(aClient *), aClient *, char *, ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_prefix_one(aClient *, aClient *, MessageTag *, FORMAT_STRING(const char *), ...) __attribute__((format(printf,4,5)));
|
||||
extern void sendto_opers(FORMAT_STRING(char *), ...) __attribute__((format(printf,1,2)));
|
||||
extern void sendto_umode(int, FORMAT_STRING(char *), ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_umode_global(int, FORMAT_STRING(char *), ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_snomask(int snomask, FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendto_snomask_global(int snomask, FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendnotice(aClient *to, FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendnumeric(aClient *to, int numeric, ...);
|
||||
extern void sendnumericfmt(aClient *to, int numeric, char *pattern, ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_server(aClient *one, unsigned long caps, unsigned long nocaps, MessageTag *mtags, const char *format, ...) __attribute__((format(printf, 5, 6)));
|
||||
extern void sendto_ops_and_log(char *pattern, ...) __attribute__((format(printf,1,2)));
|
||||
extern void sendnumericfmt(aClient *to, int numeric, FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_server(aClient *one, unsigned long caps, unsigned long nocaps, MessageTag *mtags, FORMAT_STRING(const char *format), ...) __attribute__((format(printf, 5, 6)));
|
||||
extern void sendto_ops_and_log(FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,1,2)));
|
||||
|
||||
extern MODVAR int writecalls, writeb[];
|
||||
extern int deliver_it(aClient *cptr, char *str, int len, int *want_read);
|
||||
|
@ -453,7 +445,7 @@ extern char *strldup(const char *src, size_t n);
|
|||
|
||||
extern int dopacket(aClient *, char *, int);
|
||||
|
||||
extern void debug(int, char *, ...);
|
||||
extern void debug(int, FORMAT_STRING(char *), ...);
|
||||
#if defined(DEBUGMODE)
|
||||
extern void send_usage(aClient *, char *);
|
||||
extern void count_memory(aClient *, char *);
|
||||
|
@ -531,7 +523,7 @@ extern TLSOptions *get_tls_options_for_client(aClient *acptr);
|
|||
extern int outdated_tls_client(aClient *acptr);
|
||||
extern char *outdated_tls_client_build_string(char *pattern, aClient *acptr);
|
||||
extern long config_checkval(char *value, unsigned short flags);
|
||||
extern void config_status(char *format, ...) __attribute__((format(printf,1,2)));
|
||||
extern void config_status(FORMAT_STRING(char *format), ...) __attribute__((format(printf,1,2)));
|
||||
extern void init_random();
|
||||
extern u_char getrandom8();
|
||||
extern uint16_t getrandom16();
|
||||
|
@ -718,7 +710,7 @@ extern MODVAR aTKline *tklines[TKLISTLEN];
|
|||
extern MODVAR aTKline *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
|
||||
extern char *cmdname_by_spamftarget(int target);
|
||||
extern void unrealdns_delreq_bycptr(aClient *cptr);
|
||||
extern void sendtxtnumeric(aClient *to, char *pattern, ...) __attribute__((format(printf,2,3)));
|
||||
extern void sendtxtnumeric(aClient *to, FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,2,3)));
|
||||
extern void unrealdns_gethostbyname_link(char *name, ConfigItem_link *conf, int ipv4_only);
|
||||
extern void unrealdns_delasyncconnects(void);
|
||||
extern int is_autojoin_chan(char *chname);
|
||||
|
@ -749,7 +741,7 @@ extern MODVAR char *IsupportStrings[];
|
|||
extern void finish_auth(aClient *acptr);
|
||||
extern void read_packet(int fd, int revents, void *data);
|
||||
extern int process_packet(aClient *cptr, char *readbuf, int length, int killsafely);
|
||||
extern void sendto_realops_and_log(char *fmt, ...);
|
||||
extern void sendto_realops_and_log(FORMAT_STRING(char *fmt), ...) __attribute__((format(printf,1,2)));
|
||||
extern int parse_chanmode(ParseMode *pm, char *modebuf_in, char *parabuf_in);
|
||||
extern void config_report_ssl_error(void);
|
||||
extern int dead_link(aClient *to, char *notice);
|
||||
|
@ -854,7 +846,7 @@ extern int is_handshake_finished(aClient *sptr);
|
|||
extern void SetCapability(aClient *acptr, const char *token);
|
||||
extern void ClearCapability(aClient *acptr, const char *token);
|
||||
extern void new_message(aClient *sender, MessageTag *recv_mtags, MessageTag **mtag_list);
|
||||
extern void new_message_special(aClient *sender, MessageTag *recv_mtags, MessageTag **mtag_list, char *pattern, ...) __attribute__((format(printf,4,5)));
|
||||
extern void new_message_special(aClient *sender, MessageTag *recv_mtags, MessageTag **mtag_list, FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,4,5)));
|
||||
extern void generate_batch_id(char *str);
|
||||
extern MessageTag *find_mtag(MessageTag *mtags, const char *token);
|
||||
extern MessageTag *duplicate_mtag(MessageTag *mtag);
|
||||
|
|
|
@ -9,21 +9,15 @@
|
|||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/*
|
||||
* Proto types
|
||||
*/
|
||||
|
||||
/* You do want it to work in debug mode yes ? --DrBin */
|
||||
|
||||
/* ugly hack GRR */
|
||||
/* ugly hack GRR, for both attribute and FORMAT_STRING */
|
||||
#if !defined(__GNUC__) && !defined(__common_include__)
|
||||
#define __attribute__(x) /* nothing */
|
||||
#endif
|
||||
#ifndef FORMAT_STRING
|
||||
# define FORMAT_STRING(p) p
|
||||
#endif
|
||||
|
||||
extern char *ircvsnprintf(char *str, size_t size, const char *format, va_list);
|
||||
extern char *ircsnprintf(char *str, size_t size, const char *format, ...) __attribute__((format(printf,3,4)));
|
||||
|
||||
extern const char atoi_tab[4000];
|
||||
extern char *ircsnprintf(char *str, size_t size, FORMAT_STRING(const char *format), ...) __attribute__((format(printf,3,4)));
|
||||
|
||||
#endif
|
||||
|
|
|
@ -679,7 +679,7 @@ extern void IsupportSetValue(Isupport *isupport, const char *value);
|
|||
extern void IsupportDel(Isupport *isupport);
|
||||
extern Isupport *IsupportFind(const char *token);
|
||||
extern void IsupportSet(Module *module, const char *name, const char *value);
|
||||
extern void IsupportSetFmt(Module *module, const char *name, const char *pattern, ...) __attribute__((format(printf,3,4)));
|
||||
extern void IsupportSetFmt(Module *module, const char *name, FORMAT_STRING(const char *pattern), ...) __attribute__((format(printf,3,4)));
|
||||
extern void IsupportDelByName(const char *name);
|
||||
|
||||
extern ClientCapability *ClientCapabilityFind(const char *token, aClient *sptr);
|
||||
|
|
|
@ -36,8 +36,8 @@ extern char *collapse(char *pattern);
|
|||
extern void clear_scache_hash_table(void);
|
||||
|
||||
/* send.c */
|
||||
extern void sendto_one(aClient *, MessageTag *mtags, char *, ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_realops(char *pattern, ...) __attribute__((format(printf,1,2)));
|
||||
extern void sendto_one(aClient *, MessageTag *mtags, FORMAT_STRING(char *), ...) __attribute__((format(printf,3,4)));
|
||||
extern void sendto_realops(FORMAT_STRING(char *pattern), ...) __attribute__((format(printf,1,2)));
|
||||
|
||||
/* ircd.c */
|
||||
extern EVENT(garbage_collect);
|
||||
|
|
|
@ -226,6 +226,18 @@ extern char OSName[256];
|
|||
#define __attribute__(x) /* nothing */
|
||||
#endif
|
||||
|
||||
#undef FORMAT_STRING
|
||||
#if _MSC_VER >= 1400
|
||||
# include <sal.h>
|
||||
# if _MSC_VER > 1400
|
||||
# define FORMAT_STRING(p) _Printf_format_string_ p
|
||||
# else
|
||||
# define FORMAT_STRING(p) __format_string p
|
||||
# endif /* FORMAT_STRING */
|
||||
#else
|
||||
# define FORMAT_STRING(p) p
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* A normal abort() on windows causes the crucial stack frame to be missing
|
||||
* from the stack trace, IOTW: you don't see where abort() was called!
|
||||
* It's silly but this works:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue