diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-07-24 01:15:43 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-07-24 01:15:43 +0000 |
commit | 4c921dd7a04fb366e8891a7d593feb4485f95ed2 (patch) | |
tree | 56f38a7650eb403718a70cecac2747581676191d /lib/libc/arch/m68k/string | |
parent | f1072800c624dea98bbe46e6d5c0debcb75c43c2 (diff) |
warn about unsafe APIs at link time. Conditional on libc/Makefile defining
APIWARN; disabled by default. In use by many developers for quite some time,
now they have a common knob to enable/disable this
Diffstat (limited to 'lib/libc/arch/m68k/string')
-rw-r--r-- | lib/libc/arch/m68k/string/strcat.S | 9 | ||||
-rw-r--r-- | lib/libc/arch/m68k/string/strcpy.S | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/libc/arch/m68k/string/strcat.S b/lib/libc/arch/m68k/string/strcat.S index d809086ec23..504ab936fec 100644 --- a/lib/libc/arch/m68k/string/strcat.S +++ b/lib/libc/arch/m68k/string/strcat.S @@ -33,9 +33,16 @@ #include "DEFS.h" +#if defined(APIWARN) +#APP + .stabs "warning: strcat() is almost always misused, consider using strlcat()",30,0,0,0 + .stabs "_strcat",1,0,0,0 +#NO_APP +#endif + #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: strcat.S,v 1.5 2003/06/11 21:06:33 deraadt Exp $" + .asciz "$OpenBSD: strcat.S,v 1.6 2003/07/24 01:15:42 deraadt Exp $" #endif /* LIBC_SCCS */ ENTRY(strcat) diff --git a/lib/libc/arch/m68k/string/strcpy.S b/lib/libc/arch/m68k/string/strcpy.S index 7c175322fc3..db118cfb0c6 100644 --- a/lib/libc/arch/m68k/string/strcpy.S +++ b/lib/libc/arch/m68k/string/strcpy.S @@ -33,9 +33,17 @@ #include "DEFS.h" + +#if defined(APIWARN) +#APP + .stabs "warning: strcpy() is almost always misused, consider using strlcpy()",30,0,0,0 + .stabs "_strcpy",1,0,0,0 +#NO_APP +#endif + #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: strcpy.S,v 1.6 2003/06/11 21:06:33 deraadt Exp $" + .asciz "$OpenBSD: strcpy.S,v 1.7 2003/07/24 01:15:42 deraadt Exp $" #endif /* LIBC_SCCS */ ENTRY(strcpy) |