I am trying to make my own implementation of a memory allocator in C. When I try to compile my code in the terminal on Mac OS Catalina it says that the function "sbrk" is deprecated. Does anybody know a solution to fix this? The other solutions online have seemed to be a bit outdated.
Mac OS Catalina sbrk is deprecated
1.5k views Asked by joycem8845 At
2
There are 2 answers
0
Eric Postpischil
On
“Deprecated” means the routine is still available (for now) but you are advised not to use it in new software. If you are just writing for experimental/learning purposes, you can compile anyway. Use the switch -Wno-deprecreated-declarations to turn off the warning message. If you are writing software to be published or to be used over a long time, use mmap.
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in MACOS
- Error installing Nativescript on Mac M2 Sonoma 14.4.1
- macOS - Most secure way of a GUI SUDO_ASKPASS
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- ZSH function parameters conundrum
- how to make read only file/directory in Mac writable
- macOS BigSur - Unable to run bundled php version or brew php 8
- 9 Digit Addresses in Hexadecimal System in MacOS
- MacOS Bash-Script: while read p and echo
- How to make a range for tail rows on a categorized table in Numbers with JXA scripts?
- Cannot build a basic project with curl on Mac (M2) for Raspberry Pi Pico
- How to recover deleted files from create vite react project
- Can't run built SFML project from Xcode template
- React Native - RealmJS - Linker command failed with exit code 1
- How can I manually add a keyboard shortcut to a Shortcut Action Service directly via the system files, without going through the System Prefs GUI?
Related Questions in MALLOC
- I need to create a malloc array of strings and print those strings out
- Mallocing int* inside of int** gives unexpected integer values in the first and sometimes second allocation
- For practical purposes does this malloc() code initialize a variable size array?
- Incorrect implementation of calloc() introduces division by zero and how to detect it via testing?
- Confusion about memory layout when allocating memory with malloc
- malloc implementation : checking for correct allocation alignment
- free(): invalid pointer Aborted (code dumped) (ubuntu C)
- When I assigned a static global pointer, segmentation fault occurred
- How do I free memory allocated to a void* member of a struct in my c project without breaking my GoogleTest project?
- Java process RSS & MALLOC_ARENA_MAX relation
- How to put an allocated array (sizes known at runtime) in a struct?
- Dynamic memory allocation in c arrays of structs
- Is malloc(sizeof(char[length])) incorrect?
- Immediately release memory to OS with jemalloc
- With overcommit disabled, when will malloc() return NULL on Linux?
Related Questions in DEPRECATED
- Insight: Deprecated APIs removed in Kubernetes v1.29
- Android Java Warning: get(String) in BaseBundle has been deprecated
- cudaFuncSetSharedMemConfig is deprecated in 12.4 - why?
- Apple deprecated verifyReceipt, how we check for receipt status now
- 'connections' is deprecated. The declaration was marked as deprecated here
- ImportError: cannot import name 'LocallyConnected2D' from 'tensorflow.keras.layers'
- PHP Deprecated: Optional parameter on PHP8.2 upgraded from PHP7
- TypeScript - Mark npm package as deprecated in code base
- Deprecated: preg_split():
- using [[deprecated]]
- Applying Flutters app_plugin_loader Gradle plugin imperatively using the apply script method which is deprecated, will be removed in a future release
- I’m facing an issue related to the deprecation of the singleLine attribute in Android
- Find Deprecated releases of all the azure resources for java sdk using python script or any other script
- android java onBackPressed deprecated
- jobBuilderFactory deprecation
Related Questions in SBRK
- How does sbrk in MIPS properly get called
- Efficient 2 pass using heap memory
- Can the pointer returned by sys _brk overlap the stack on Linux?
- Why does this code segfault on one machine but run fine on another?
- Why do I hit Invalid write/read after sbrk (recoding mini malloc)?
- Abort in glibc while trying to use sbrk to reduce the size of the data segment
- How to free the heap memory in MIPS
- Why would I get an error like this when calling sbrk()?
- Where does malloc() allocate memory? Is it the data section or the heap section of the virtual address space of the process?
- warning: implicit declaration of function 'sbrk' after Importing unistd.h
- C++ Malloc Doesn't call mmap or brk?
- How to Convert Void* into size_t?
- Can I enforce sbrk return address to be within a certain specific range?
- sbrk() - cast to pointer from integer of different size
- Mac OS Catalina sbrk is deprecated
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
In practice, the term "deprecated" (like the related word "obsolescent") can mean at least three different things:
Many times, these meanings are used in combination. One example is the C library function
gets(), which just about everyone agrees is Bad (so meaning #2 applies), and has in fact been removed from the C Standard by now (so meaning #1 applies also).As far as I know,
sbrkis an example of meaning #3. There's nothing particularly wrong with it, but there are better and more modern ways of doing the same thing -- although the newer way(s) might also be more complicated, meaning there's an incentive to do it the old way if you want to keep things simple. Other examples of this sort of things are the system callssignalandcreat.At the risk of editorializing (ok, I admit it, I am editorializing), meaning #3 can get interesting when it comes to language or standards evolution. If you believe in backwards compatibility and long-term stability, if you believe programmers ought to be able to write well-intentioned code and have it run forever, you won't throw meaning #1 at them just because meaning #3 applies. But if you want to force people to think like you do, and if you've given up on software stability (since everything's constantly getting rewritten to keep up with new features and new bugs and newly changed standards anyway), and if you think that backwards compatibility is backwards and too much work, you can use meaning #1 all the time, even though it drives me up a tree. :-(