Contents
Clobbering
In software engineering and computer science, clobbering a file, processor register or a region of computer memory is the process of overwriting its contents completely, whether intentionally or unintentionally, or to indicate that such an action will likely occur. The Jargon File defines clobbering as "To overwrite, usually unintentionally: "I walked off the end of the array and clobbered the stack." Compare mung, scribble, trash, and smash the stack."
POSIX
Memory or file overwrites in POSIX systems, as well as in shells such as Bash, often happen unintentionally - such as using the redirection operator. Therefore, to prevent unintentional clobbering, various means can be used - for example, setting the shell parameter (bash, ksh) or (csh, tcsh) will prevent from clobbering by making it issue an error message instead: The default behavior of the mv and cp commands is to clobber their destination file if it already exists. This behavior may be overridden by invoking or aliasing the commands with the switch, causing the commands to prompt the user before overwriting the destination file, or to not transfer source files with a naming conflict.
Makefiles
In makefiles, a common target clobber means complete cleanup of all unnecessary files and directories produced by previous invocations of the command. It is a more severe target than clean and is commonly used to uninstall software. Some make-related commands invoke "make clobber" during their execution. They check the CLOBBER environment variable. If it is set to OFF then clobbering is not done.
Assembly
In assembler programming - including inline extended assembly as supported in C and C++ through GCC - the term clobbered registers is often used to denote any registers whose value may be overwritten during the course of executing an instruction or instructions.
This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.
Wikipedia® is a registered trademark of the
Wikimedia Foundation, Inc.
Bliptext is not
affiliated with or endorsed by Wikipedia or the
Wikimedia Foundation.