Questions tagged [weak]

128 questions
0
votes
1 answer

When linking with --no-undefined and --as-needed, how should weak symbols be handled

When I link a shared library with --as-needed and --no-undefined, I see an error that indicates pthread_create is missing and is referenced by libstdc++_nonshared.a. If I remove --as-needed, the library links and ldd indicates that pthread.so is a…
0
votes
0 answers

Code stuck at ".thumb_func .weak HardFault_HandlerHardFault_Handler" on NRF52840 using PCA10056

I'm working on a project using an NRF52840 microcontroller and the PCA10056 development board. When I debug my code, it gets stuck at the following line: .thumb_func .weak HardFault_Handler HardFault_Handler: b when i build the project i get no eror
0
votes
0 answers

using ELF weak symbols to enable a feature if two other features need it

I'm developing a static library (*.a file) with GCC and an ELF target. I need the following (AND12 setup): the data part must be linked into the executable iff both features feature1 and feature2 are linked in (because they are used) feature3…
pts
  • 80,836
  • 20
  • 110
  • 183
0
votes
0 answers

why no error message when alias function with different prototype?

test.c void __f () { /* Do something. */; } int f (int) __attribute__ ((weak, alias ("__f"))); test.h void f (); main.c //call f f(); the __f() and alias f() has different prototype. use build tools gcc-arm-none-eabi-4_9, no error or warning…
yyd
  • 33
  • 5
0
votes
0 answers

How to retain lazy instance in cross ref objects

Given two classes which reference each other and one of the refs is weak, how do I retain it when initialising locally? This is the structure of the code: class Generator { weak var machine: Machine! public init(for machine: Machine) { …
0
votes
0 answers

How to set GUI options for three.js globe texture? Weakmap error

I've added gui options for my globe to change textures but I get the error "TypeError: Attempted to set a non-object key in a WeakMap" I think the error is related to the textures I'm using. what can I do to fix the gui error? here is my code: …
shange
  • 77
  • 7
0
votes
1 answer

In Javascript, is there a way to make strict comparison "greater than" or "smaller than" operations?

Is there a way in Javascript to make strict comparison operations other than the one allowed with '===', i.e., a strict '<', '>', '<=' and '>='? The code below using '<' performs a weak operation between a string and an integer. I would like to know…
Alejandro
  • 37
  • 9
0
votes
1 answer

Can I use RunLoop for realtime object observing in Swift?

I have a Process object (is kind of Model). Inside a process, I have an array of tuples var listeners: [(WeakContainer, (S) -> ())] WeakContainer handles a weak ref inside. I need to remove an element from the listeners array when…
Ihor M.
  • 184
  • 10
0
votes
1 answer

assembly weak symbol not working as (I) expected

I am cross compiling with riscv-corev32-elf-gcc. In a first file 'generic.S' I have the following code: .section .text.handlers .weak u_sw_irq_handler .weak __no_irq_handler .section .vectors, "ax" vector_table: jal x0, u_sw_irq_handler …
Guillaume D
  • 2,202
  • 2
  • 10
  • 37
0
votes
1 answer

Java WeakReference is still holding valid reference when referent is no longer valid

I'm confused with this program: class Point { private final int x; private final int y; } public class App { WeakReference newPoint() { Point referent = new Point(); return new WeakReference(referent); //…
Troskyvs
  • 7,537
  • 7
  • 47
  • 115
0
votes
0 answers

swift how to store a weak reference to a class & protocol in a generic

I have a bunch of classes derived from UIView derivatives. Those clases also conform to protocol commonFunctions. I store them for further use in a dictionary, like this: var elementsStore:[String:UIView & commonFunctions] and protocol…
Alfredo Meraz
  • 139
  • 1
  • 7
0
votes
1 answer

Use [weak self] in the nested block in swift

I'm working on calling an animation in Swift and I'm a bit confused with using [weak self] in the nested block. I saw some other posts related to this question, but it confused me because some say they need the weak self, and some don't. My…
Yuuu
  • 715
  • 1
  • 9
  • 32
0
votes
2 answers

Android app with weak reference and singleton

I'm in the process of completely redesigning my Android app. Before, EVERYTHING was in the same class. So I tried to redraw everything so that the code is clearer apart Admob than the doc advice to put in the Main thread, I separate the…
0
votes
1 answer

How to force user implement __weak functions

I'm writing a library and have some __weak functions which need to be overwritten by the programmers. I want to make sure they do so, so I did this: __weak void checkButtons(){ #warning "Implement this" } And put the prototype in the…
Mohammad Kholghi
  • 533
  • 2
  • 7
  • 21
0
votes
0 answers

Weak Encryption: Inadequate RSA Padding

The security check tool Fortify has detected vulnerability on the lines RSAPKCS1SignatureDeformatter deformatter = new RSAPKCS1SignatureDeformatter(key); deformatter.SetHashAlgorithm("SHA256"); The CreateDeformatter() method performs public key RSA…
dilla
  • 1
  • 3
1 2 3
8 9