On 5/27/25 14:17, Bruno Haible wrote:
     For example, a question like
       In C, is there a way to determine whether the currently executing thread
       is inside a signal handler? ...
     is generic enough, that the answer is likely correct.

Heh, I just asked Gemini (2.5 Flash) that question, and it responded with an intelligent-looking answer along with code that almost always (but not always) works and which contained this stylistic howler:

  volatile sig_atomic_t in_signal_handler = 0;
  void my_signal_handler(int signum) {
      in_signal_handler = 1;
  }

... and of course examining in_signal_handler does not tell you whether the currently executing thread is in a signal handler.

Anyway, I suppose I should limit my use of genAI when writing detailed technical documentation.

Reply via email to